diff --git a/assets/Basic-BGRWPjtG.js b/assets/Basic-C8g-kAol.js similarity index 83% rename from assets/Basic-BGRWPjtG.js rename to assets/Basic-C8g-kAol.js index 36e4a0c8e0d8a681065f47c63052ca2e879e5164..897585632417a06794b3ec81c47858407fafbfc5 100644 --- a/assets/Basic-BGRWPjtG.js +++ b/assets/Basic-C8g-kAol.js @@ -1 +1 @@ -import{createElementBlock as e,defineComponent as t,mergeModels as n,normalizeStyle as r,openBlock as i,ref as a,useModel as o,vModelText as s,watch as c,withDirectives as l}from"./index-BSwg6FIo.js";var u=t({__name:`Basic`,props:{modelValue:{default:``},modelModifiers:{}},emits:n([`submit`],[`update:modelValue`]),setup(t,{emit:n}){let u=n,d=o(t,`modelValue`),f=a(),p=a(`auto`);function m(e){e.code===`Enter`&&!e.shiftKey&&(e.preventDefault(),u(`submit`,d.value))}return c(d,()=>{p.value=`auto`,requestAnimationFrame(()=>{f.value&&(p.value=`${f.value.scrollHeight}px`)})},{immediate:!0}),(t,n)=>l((i(),e(`textarea`,{ref_key:`textareaRef`,ref:f,"onUpdate:modelValue":n[0]||=e=>d.value=e,style:r({height:p.value}),onKeydown:m},null,36)),[[s,d.value]])}}),d=u;export{d as Basic_default}; \ No newline at end of file +import{createElementBlock as e,defineComponent as t,mergeModels as n,normalizeStyle as r,openBlock as i,ref as a,useModel as o,vModelText as s,watch as c,withDirectives as l}from"./index-DKziOBM4.js";var u=t({__name:`Basic`,props:{modelValue:{default:``},modelModifiers:{}},emits:n([`submit`],[`update:modelValue`]),setup(t,{emit:n}){let u=n,d=o(t,`modelValue`),f=a(),p=a(`auto`);function m(e){e.code===`Enter`&&!e.shiftKey&&(e.preventDefault(),u(`submit`,d.value))}return c(d,()=>{p.value=`auto`,requestAnimationFrame(()=>{f.value&&(p.value=`${f.value.scrollHeight}px`)})},{immediate:!0}),(t,n)=>l((i(),e(`textarea`,{ref_key:`textareaRef`,ref:f,"onUpdate:modelValue":n[0]||=e=>d.value=e,style:r({height:p.value}),onKeydown:m},null,36)),[[s,d.value]])}}),d=u;export{d as Basic_default}; \ No newline at end of file diff --git a/assets/Button-AEge-Qyg.js b/assets/Button-DdtiAfEa.js similarity index 98% rename from assets/Button-AEge-Qyg.js rename to assets/Button-DdtiAfEa.js index 3fb3dbade959475ada3e347427c16db638986909..cf57ce63df7d0203142b6a8e909acd9e60610fbc 100644 --- a/assets/Button-AEge-Qyg.js +++ b/assets/Button-DdtiAfEa.js @@ -1 +1 @@ -import{Transition as e,__plugin_vue_export_helper_default as t,computed as n,createBaseVNode as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createTextVNode as s,createVNode as c,defineComponent as l,guardReactiveProps as u,mergeModels as d,mergeProps as f,normalizeClass as p,normalizeProps as m,openBlock as h,renderSlot as g,toDisplayString as _,unref as v,useModel as y,watchEffect as b,withCtx as x}from"./index-BSwg6FIo.js";var S=l({__name:`BidirectionalTransition`,props:{fromClass:null,activeClass:null,toClass:null},setup(t){return(n,r)=>(h(),i(e,{"enter-from-class":t.fromClass,"enter-active-class":t.activeClass,"enter-to-class":t.toClass,"leave-from-class":t.toClass,"leave-active-class":t.activeClass,"leave-to-class":t.fromClass},{default:x(()=>[g(n.$slots,`default`)]),_:3},8,[`enter-from-class`,`enter-active-class`,`enter-to-class`,`leave-from-class`,`leave-active-class`,`leave-to-class`]))}}),C=S;const w=`0px`;var T=l({__name:`TransitionVertical`,props:{duration:{default:250},easingEnter:{default:`ease-in-out`},easingLeave:{default:`ease-in-out`},opacityClosed:{default:0},opacityOpened:{default:1}},setup(t){let n=t;function r(e){return{height:e.style.height,width:e.style.width,position:e.style.position,visibility:e.style.visibility,overflow:e.style.overflow,paddingTop:e.style.paddingTop,paddingBottom:e.style.paddingBottom,borderTopWidth:e.style.borderTopWidth,borderBottomWidth:e.style.borderBottomWidth,marginTop:e.style.marginTop,marginBottom:e.style.marginBottom}}function a(e,t){let{width:n}=getComputedStyle(e);e.style.width=n,e.style.position=`absolute`,e.style.visibility=`hidden`,e.style.height=``;let{height:r}=getComputedStyle(e);return e.style.width=t.width,e.style.position=t.position,e.style.visibility=t.visibility,e.style.height=w,e.style.overflow=`hidden`,t.height&&t.height!==w?t.height:r}function o(e,t,n,r,i){let a=e.animate(r,i);e.style.height=t.height,a.onfinish=()=>{e.style.overflow=t.overflow,n()}}function s(e,t){return[{height:w,opacity:n.opacityClosed,paddingTop:w,paddingBottom:w,borderTopWidth:w,borderBottomWidth:w,marginTop:w,marginBottom:w},{height:e,opacity:n.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function c(e,t){let i=e,c=r(i),l=a(i,c),u=s(l,c),d={duration:n.duration,easing:n.easingEnter};o(i,c,t,u,d)}function l(e,t){let i=e,a=r(i),{height:c}=getComputedStyle(i);i.style.height=c,i.style.overflow=`hidden`;let l=s(c,a).reverse(),u={duration:n.duration,easing:n.easingLeave};o(i,a,t,l,u)}return(t,n)=>(h(),i(e,{css:!1,onEnter:c,onLeave:l},{default:x(()=>[g(t.$slots,`default`)]),_:3}))}}),E=T;const D={op50:``};var O=l({__name:`Collapsable`,props:d({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=y(e,`modelValue`);b(()=>{t.default!=null&&(n.value=!!t.default)});function i(e){return n.value=e,e}return(e,l)=>(h(),o(`div`,null,[g(e.$slots,`trigger`,m(u({visible:n.value,setVisible:i})),()=>[r(`button`,{sticky:``,"top-0":``,"z-10":``,flex:``,"items-center":``,"justify-between":``,px2:``,py1:``,"text-sm":``,"backdrop-blur-xl":``,onClick:l[0]||=e=>n.value=!n.value},[r(`span`,null,_(t.label??`Collapsable`),1),l[1]||=s(),r(`span`,D,_(n.value?`▲`:`▼`),1)])]),c(v(E),null,{default:x(()=>[n.value?g(e.$slots,`default`,m(f({key:0},{visible:n.value,setVisible:i}))):a(``,!0)]),_:3})]))}}),k=O,A=l({__name:`Skeleton`,props:{animation:{default:`pulse`}},setup(e){let t=e;return(e,n)=>(h(),o(`div`,{class:p([`skeleton`,t.animation===`none`?``:`skeleton-${t.animation}`]),bg:`neutral-200 dark:neutral-800`,overflow:`hidden`},[g(e.$slots,`default`,{},void 0,!0)],2))}}),j=t(A,[[`__scopeId`,`data-v-f404da2a`]]);const M=[`disabled`],N={class:`flex flex-row items-center justify-center`},P={key:0,class:`mr-2 w-4`},F={key:0,class:`i-svg-spinners:ring-resize h-4 w-4`},I={key:0};var L=l({__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(e){let t=e,i=n(()=>t.disabled||t.loading),s={primary:`bg-primary-500 hover:bg-primary-600 dark:bg-primary-400 dark:hover:bg-primary-500 focus:ring-primary-500/50 dark:focus:ring-primary-400/50 text-white`,secondary:`bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-600 dark:hover:bg-neutral-500 focus:ring-neutral-300/50 dark:focus:ring-neutral-600/50 text-neutral-900 dark:text-neutral-100`,danger:`bg-red-500 hover:bg-red-600 dark:bg-red-400 dark:hover:bg-red-500 focus:ring-red-600/50 dark:focus:ring-red-500/50 text-white`},l={sm:`px-3 py-1.5 text-xs`,md:`px-4 py-2 text-sm`,lg:`px-6 py-3 text-base`},u=n(()=>[`rounded-lg font-medium outline-none transition-all duration-200 ease-in-out`,`disabled:cursor-not-allowed disabled:opacity-50`,t.block?`w-full`:``,l[t.size],s[t.variant],{"opacity-50 cursor-not-allowed":i.value},`focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900`]);return(t,n)=>(h(),o(`button`,{disabled:i.value,class:p(u.value)},[r(`div`,N,[c(v(C),{"from-class":`opacity-0 mr-0! w-0!`,"active-class":`transition-[width,margin] ease-in-out overflow-hidden`},{default:x(()=>[e.loading||e.icon?(h(),o(`div`,P,[e.loading?(h(),o(`div`,F)):e.icon?(h(),o(`div`,{key:1,class:p([`h-4 w-4`,e.icon])},null,2)):a(``,!0)])):a(``,!0)]),_:1}),e.label?(h(),o(`span`,I,_(e.label),1)):g(t.$slots,`default`,{key:1})])],10,M))}}),R=L;export{R as Button_default,k as Collapsable_default,j as Skeleton_default,E as TransitionVertical_default}; \ No newline at end of file +import{Transition as e,__plugin_vue_export_helper_default as t,computed as n,createBaseVNode as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createTextVNode as s,createVNode as c,defineComponent as l,guardReactiveProps as u,mergeModels as d,mergeProps as f,normalizeClass as p,normalizeProps as m,openBlock as h,renderSlot as g,toDisplayString as _,unref as v,useModel as y,watchEffect as b,withCtx as x}from"./index-DKziOBM4.js";var S=l({__name:`BidirectionalTransition`,props:{fromClass:null,activeClass:null,toClass:null},setup(t){return(n,r)=>(h(),i(e,{"enter-from-class":t.fromClass,"enter-active-class":t.activeClass,"enter-to-class":t.toClass,"leave-from-class":t.toClass,"leave-active-class":t.activeClass,"leave-to-class":t.fromClass},{default:x(()=>[g(n.$slots,`default`)]),_:3},8,[`enter-from-class`,`enter-active-class`,`enter-to-class`,`leave-from-class`,`leave-active-class`,`leave-to-class`]))}}),C=S;const w=`0px`;var T=l({__name:`TransitionVertical`,props:{duration:{default:250},easingEnter:{default:`ease-in-out`},easingLeave:{default:`ease-in-out`},opacityClosed:{default:0},opacityOpened:{default:1}},setup(t){let n=t;function r(e){return{height:e.style.height,width:e.style.width,position:e.style.position,visibility:e.style.visibility,overflow:e.style.overflow,paddingTop:e.style.paddingTop,paddingBottom:e.style.paddingBottom,borderTopWidth:e.style.borderTopWidth,borderBottomWidth:e.style.borderBottomWidth,marginTop:e.style.marginTop,marginBottom:e.style.marginBottom}}function a(e,t){let{width:n}=getComputedStyle(e);e.style.width=n,e.style.position=`absolute`,e.style.visibility=`hidden`,e.style.height=``;let{height:r}=getComputedStyle(e);return e.style.width=t.width,e.style.position=t.position,e.style.visibility=t.visibility,e.style.height=w,e.style.overflow=`hidden`,t.height&&t.height!==w?t.height:r}function o(e,t,n,r,i){let a=e.animate(r,i);e.style.height=t.height,a.onfinish=()=>{e.style.overflow=t.overflow,n()}}function s(e,t){return[{height:w,opacity:n.opacityClosed,paddingTop:w,paddingBottom:w,borderTopWidth:w,borderBottomWidth:w,marginTop:w,marginBottom:w},{height:e,opacity:n.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function c(e,t){let i=e,c=r(i),l=a(i,c),u=s(l,c),d={duration:n.duration,easing:n.easingEnter};o(i,c,t,u,d)}function l(e,t){let i=e,a=r(i),{height:c}=getComputedStyle(i);i.style.height=c,i.style.overflow=`hidden`;let l=s(c,a).reverse(),u={duration:n.duration,easing:n.easingLeave};o(i,a,t,l,u)}return(t,n)=>(h(),i(e,{css:!1,onEnter:c,onLeave:l},{default:x(()=>[g(t.$slots,`default`)]),_:3}))}}),E=T;const D={op50:``};var O=l({__name:`Collapsable`,props:d({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=y(e,`modelValue`);b(()=>{t.default!=null&&(n.value=!!t.default)});function i(e){return n.value=e,e}return(e,l)=>(h(),o(`div`,null,[g(e.$slots,`trigger`,m(u({visible:n.value,setVisible:i})),()=>[r(`button`,{sticky:``,"top-0":``,"z-10":``,flex:``,"items-center":``,"justify-between":``,px2:``,py1:``,"text-sm":``,"backdrop-blur-xl":``,onClick:l[0]||=e=>n.value=!n.value},[r(`span`,null,_(t.label??`Collapsable`),1),l[1]||=s(),r(`span`,D,_(n.value?`▲`:`▼`),1)])]),c(v(E),null,{default:x(()=>[n.value?g(e.$slots,`default`,m(f({key:0},{visible:n.value,setVisible:i}))):a(``,!0)]),_:3})]))}}),k=O,A=l({__name:`Skeleton`,props:{animation:{default:`pulse`}},setup(e){let t=e;return(e,n)=>(h(),o(`div`,{class:p([`skeleton`,t.animation===`none`?``:`skeleton-${t.animation}`]),bg:`neutral-200 dark:neutral-800`,overflow:`hidden`},[g(e.$slots,`default`,{},void 0,!0)],2))}}),j=t(A,[[`__scopeId`,`data-v-f404da2a`]]);const M=[`disabled`],N={class:`flex flex-row items-center justify-center`},P={key:0,class:`mr-2 w-4`},F={key:0,class:`i-svg-spinners:ring-resize h-4 w-4`},I={key:0};var L=l({__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(e){let t=e,i=n(()=>t.disabled||t.loading),s={primary:`bg-primary-500 hover:bg-primary-600 dark:bg-primary-400 dark:hover:bg-primary-500 focus:ring-primary-500/50 dark:focus:ring-primary-400/50 text-white`,secondary:`bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-600 dark:hover:bg-neutral-500 focus:ring-neutral-300/50 dark:focus:ring-neutral-600/50 text-neutral-900 dark:text-neutral-100`,danger:`bg-red-500 hover:bg-red-600 dark:bg-red-400 dark:hover:bg-red-500 focus:ring-red-600/50 dark:focus:ring-red-500/50 text-white`},l={sm:`px-3 py-1.5 text-xs`,md:`px-4 py-2 text-sm`,lg:`px-6 py-3 text-base`},u=n(()=>[`rounded-lg font-medium outline-none transition-all duration-200 ease-in-out`,`disabled:cursor-not-allowed disabled:opacity-50`,t.block?`w-full`:``,l[t.size],s[t.variant],{"opacity-50 cursor-not-allowed":i.value},`focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900`]);return(t,n)=>(h(),o(`button`,{disabled:i.value,class:p(u.value)},[r(`div`,N,[c(v(C),{"from-class":`opacity-0 mr-0! w-0!`,"active-class":`transition-[width,margin] ease-in-out overflow-hidden`},{default:x(()=>[e.loading||e.icon?(h(),o(`div`,P,[e.loading?(h(),o(`div`,F)):e.icon?(h(),o(`div`,{key:1,class:p([`h-4 w-4`,e.icon])},null,2)):a(``,!0)])):a(``,!0)]),_:1}),e.label?(h(),o(`span`,I,_(e.label),1)):g(t.$slots,`default`,{key:1})])],10,M))}}),R=L;export{R as Button_default,k as Collapsable_default,j as Skeleton_default,E as TransitionVertical_default}; \ No newline at end of file diff --git a/assets/CardCreate-D42uwy43.js b/assets/CardCreate-4reXB0pk.js similarity index 93% rename from assets/CardCreate-D42uwy43.js rename to assets/CardCreate-4reXB0pk.js index eeaebae1b10ad3b744a48e3d5070213a3bf2edfd..372e790cc07925507cca5132ead9c6c959ca1eb6 100644 --- a/assets/CardCreate-D42uwy43.js +++ b/assets/CardCreate-4reXB0pk.js @@ -1 +1 @@ -import{createBaseVNode as e,createElementBlock as t,defineComponent as n,openBlock as r,toDisplayString as i,unref as a,useI18n as o}from"./index-BSwg6FIo.js";const s={relative:``,class:`min-h-[120px] flex flex-col cursor-pointer items-center justify-center border-neutral-200 rounded-xl bg-white/60 p-6 dark:border-neutral-700 hover:border-primary-300 dark:bg-black/30 hover:bg-white/80 dark:hover:border-primary-700 dark:hover:bg-black/40`,border:`solid 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`},c={"font-medium":``,text:`neutral-600 dark:neutral-300`};var l=n({__name:`CardCreate`,setup(n){let{t:l}=o();return(n,o)=>(r(),t(`div`,s,[o[0]||=e(`div`,{"i-solar:add-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),e(`p`,c,i(a(l)(`settings.pages.card.create_card`)),1)]))}}),u=l;export{u as CardCreate_default}; \ No newline at end of file +import{createBaseVNode as e,createElementBlock as t,defineComponent as n,openBlock as r,toDisplayString as i,unref as a,useI18n as o}from"./index-DKziOBM4.js";const s={relative:``,class:`min-h-[120px] flex flex-col cursor-pointer items-center justify-center border-neutral-200 rounded-xl bg-white/60 p-6 dark:border-neutral-700 hover:border-primary-300 dark:bg-black/30 hover:bg-white/80 dark:hover:border-primary-700 dark:hover:bg-black/40`,border:`solid 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`},c={"font-medium":``,text:`neutral-600 dark:neutral-300`};var l=n({__name:`CardCreate`,setup(n){let{t:l}=o();return(n,o)=>(r(),t(`div`,s,[o[0]||=e(`div`,{"i-solar:add-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),e(`p`,c,i(a(l)(`settings.pages.card.create_card`)),1)]))}}),u=l;export{u as CardCreate_default}; \ No newline at end of file diff --git a/assets/CardCreate-93Vgljnn.js b/assets/CardCreate-93Vgljnn.js deleted file mode 100644 index 9e7b167ca4c01b70fe812a4653af6c5a4a7b2ed6..0000000000000000000000000000000000000000 --- a/assets/CardCreate-93Vgljnn.js +++ /dev/null @@ -1 +0,0 @@ -import{CardCreate_default as e}from"./CardCreate-D42uwy43.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreate-DIURsdhI.js b/assets/CardCreate-DIURsdhI.js new file mode 100644 index 0000000000000000000000000000000000000000..b0d96f5c16c0c4837410925b165f6ba877af6d52 --- /dev/null +++ b/assets/CardCreate-DIURsdhI.js @@ -0,0 +1 @@ +import{CardCreate_default as e}from"./CardCreate-4reXB0pk.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-BsyNmiYp.js b/assets/CardCreationDialog-Cv_Hyp_I.js similarity index 96% rename from assets/CardCreationDialog-BsyNmiYp.js rename to assets/CardCreationDialog-Cv_Hyp_I.js index f4d922b5ac9eee07fe78719fe851d45db34db3a0..451f8f2550a03c73a667e10961608e0476373959 100644 --- a/assets/CardCreationDialog-BsyNmiYp.js +++ b/assets/CardCreationDialog-Cv_Hyp_I.js @@ -1,3 +1,3 @@ -import{Fragment as e,__commonJSMin as t,__plugin_vue_export_helper_default as n,__toESM as r,computed as i,createBaseVNode as a,createBlock as o,createCommentVNode as s,createElementBlock as c,createTextVNode as l,createVNode as u,defineComponent as d,isRef as f,mergeModels as p,normalizeClass as m,openBlock as h,ref as g,renderList as ee,toDisplayString as _,toRaw as te,unref as v,useI18n as y,useModel as b,withCtx as x}from"./index-BSwg6FIo.js";import{useAiriCardStore as ne}from"./stores-BzkLfyIH.js";import{Button_default as S}from"./Button-AEge-Qyg.js";import{FieldInput_default as C,FieldValues_default as re}from"./src-CX9nVT7I.js";import{$u as w,Bu as T,Iv as ie,Pu as ae,nu as oe}from"./dist-BziUufTI.js";var E=t((exports,t)=>{function n(e){return e.toLowerCase()}t.exports=n}),D=t((exports,t)=>{var n=E();t.exports=n}),O=t((exports,t)=>{function n(e,t,n){return e.replace(t,n)}t.exports=n}),k=t((exports,t)=>{var n=O();t.exports=n}),A=t((exports,t)=>{var n=String.prototype.trim!==void 0;t.exports=n}),j=t((exports,t)=>{var n=String.prototype.trim;t.exports=n}),M=t((exports,t)=>{var n=j(),r=` +import{Fragment as e,__commonJSMin as t,__plugin_vue_export_helper_default as n,__toESM as r,computed as i,createBaseVNode as a,createBlock as o,createCommentVNode as s,createElementBlock as c,createTextVNode as l,createVNode as u,defineComponent as d,isRef as f,mergeModels as p,normalizeClass as m,openBlock as h,ref as g,renderList as ee,toDisplayString as _,toRaw as te,unref as v,useI18n as y,useModel as b,withCtx as x}from"./index-DKziOBM4.js";import{useAiriCardStore as ne}from"./stores-zsAuCjXz.js";import{Button_default as S}from"./Button-DdtiAfEa.js";import{FieldInput_default as C,FieldValues_default as re}from"./src-CmPNYgc5.js";import{$u as w,Bu as T,Iv as ie,Pu as ae,nu as oe}from"./dist-B_AZqzk2.js";var E=t((exports,t)=>{function n(e){return e.toLowerCase()}t.exports=n}),D=t((exports,t)=>{var n=E();t.exports=n}),O=t((exports,t)=>{function n(e,t,n){return e.replace(t,n)}t.exports=n}),k=t((exports,t)=>{var n=O();t.exports=n}),A=t((exports,t)=>{var n=String.prototype.trim!==void 0;t.exports=n}),j=t((exports,t)=>{var n=String.prototype.trim;t.exports=n}),M=t((exports,t)=>{var n=j(),r=` \r \f\v            \u2028\u2029   `,i=`᠎`;function a(){return n.call(r)===``&&n.call(i)===i}t.exports=a}),N=t((exports,t)=>{var n=k(),r=/^[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*([\S\s]*?)[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*$/;function i(e){return n(e,r,`$1`)}t.exports=i}),P=t((exports,t)=>{var n=j();function r(e){return n.call(e)}t.exports=r}),F=t((exports,t)=>{var n=A(),r=M(),i=N(),a=P(),o;o=n&&r()?a:i,t.exports=o}),I=t((exports,t)=>{var n=D(),r=k(),i=F(),a=/\s+/g,o=/[!"'(),–.:;<>?`{}|~\/\\\[\]_#$*&^@%]+/g,s=/([a-z0-9])([A-Z])/g;function c(e){return e=r(e,o,` `),e=r(e,s,`$1 $2`),e=i(e),e=r(e,a,`-`),n(e)}t.exports=c}),L=t((exports,t)=>{var n=I();t.exports=n}),R=r(L());const z={class:`w-full flex flex-col gap-5`},B={class:`mt-4`},V={class:`border-b border-neutral-200 dark:border-neutral-700`},H={class:`flex justify-center -mb-px sm:justify-start space-x-1`},U=[`onClick`],W={class:`flex items-center gap-1`},G={key:0,class:`w-full rounded-xl bg-red900`},K={class:`w-full p-4`},se={key:1,class:`tab-content ml-auto mr-auto w-95%`},ce={class:`mb-3`},le={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},ue={key:2,class:`tab-content ml-auto mr-auto w-95%`},de={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},fe={key:3,class:`tab-content ml-auto mr-auto w-95%`},pe={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},me={class:`ml-auto mr-1 flex flex-row gap-2`};var q=d({__name:`CardCreationDialog`,props:p({modelValue:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:p([`update:modelValue`],[`update:modelValue`]),setup(t,{emit:n}){let r=n,d=b(t,`modelValue`),{t:p}=y(),E=ne(),D=g(``),O=[{id:`identity`,label:p(`settings.pages.card.creation.identity`),icon:`i-solar:emoji-funny-square-bold-duotone`},{id:`behavior`,label:p(`settings.pages.card.creation.behavior`),icon:`i-solar:chat-round-line-bold-duotone`},{id:`settings`,label:p(`settings.pages.card.creation.settings`),icon:`i-solar:settings-bold-duotone`}],k=i({get:()=>{var e;return O.find(e=>e.id===D.value)?D.value:(e=O[0])?.id||``},set:e=>{D.value=e}}),A=g(!1),j=g(``);function M(e){let t=te(e);if(t.name.length>0)if(/^(?:\d+\.)+\d+$/.test(t.version))if(t.description.length>0)if(t.personality.length>0)if(t.scenario.length>0)if(t.systemPrompt.length>0){if(!(t.postHistoryInstructions.length>0))return A.value=!0,j.value=p(`settings.pages.card.creation.errors.posthistoryinstructions`),!1}else return A.value=!0,j.value=p(`settings.pages.card.creation.errors.systemprompt`),!1;else return A.value=!0,j.value=p(`settings.pages.card.creation.errors.scenario`),!1;else return A.value=!0,j.value=p(`settings.pages.card.creation.errors.personality`),!1;else return A.value=!0,j.value=p(`settings.pages.card.creation.errors.description`),!1;else return A.value=!0,j.value=p(`settings.pages.card.creation.errors.version`),!1;else return A.value=!0,j.value=p(`settings.pages.card.creation.errors.name`),!1;return A.value=!1,E.addCard(t),d.value=!1,!0}let N=g({name:p(`settings.pages.card.creation.defaults.name`),nickname:void 0,version:`1.0`,description:``,notes:void 0,personality:p(`settings.pages.card.creation.defaults.personality`),scenario:p(`settings.pages.card.creation.defaults.scenario`),systemPrompt:p(`settings.pages.card.creation.defaults.systemprompt`),postHistoryInstructions:p(`settings.pages.card.creation.defaults.posthistoryinstructions`),greetings:[],messageExample:[]});function P(e,t){return i({get:()=>N.value[e]??``,set:n=>{let r=n.trim();N.value[e]=r.length>0?t?t(r):r:``}})}let F=P(`name`,e=>(0,R.default)(e)),I=P(`nickname`),L=P(`description`),q=P(`notes`),J=P(`personality`),Y=P(`scenario`),X=i({get:()=>N.value.greetings??[],set:e=>{N.value.greetings=e||[]}}),Z=P(`version`),Q=P(`systemPrompt`),$=P(`postHistoryInstructions`);return(t,n)=>(h(),o(v(oe),{open:d.value,"onUpdate:open":n[12]||=e=>r(`update:modelValue`,e)},{default:x(()=>[u(v(ie),null,{default:x(()=>[u(v(w),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),u(v(ae),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:x(()=>[a(`div`,z,[u(v(T),{"text-2xl":``,"font-bold":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:x(()=>[l(_(v(p)(`settings.pages.card.create_card`)),1)]),_:1}),a(`div`,B,[a(`div`,V,[a(`div`,H,[(h(),c(e,null,ee(O,e=>a(`button`,{key:e.id,class:m([`px-4 py-2 text-sm font-medium`,[k.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>k.value=e.id},[a(`div`,W,[a(`div`,{class:m(e.icon)},null,2),l(` `+_(e.label),1)])],10,U)),64))])])]),A.value?(h(),c(`div`,G,[a(`p`,K,_(j.value),1)])):s(``,!0),k.value===`identity`?(h(),c(`div`,se,[a(`p`,ce,_(v(p)(`settings.pages.card.creation.fields_info.subtitle`)),1),a(`div`,le,[u(v(C),{modelValue:v(F),"onUpdate:modelValue":n[0]||=e=>f(F)?F.value=e:null,label:v(p)(`settings.pages.card.creation.name`),description:v(p)(`settings.pages.card.creation.fields_info.name`),required:!0},null,8,[`modelValue`,`label`,`description`]),u(v(C),{modelValue:v(I),"onUpdate:modelValue":n[1]||=e=>f(I)?I.value=e:null,label:v(p)(`settings.pages.card.creation.nickname`),description:v(p)(`settings.pages.card.creation.fields_info.nickname`)},null,8,[`modelValue`,`label`,`description`]),u(v(C),{modelValue:v(L),"onUpdate:modelValue":n[2]||=e=>f(L)?L.value=e:null,label:v(p)(`settings.pages.card.creation.description`),"single-line":!1,required:!0,description:v(p)(`settings.pages.card.creation.fields_info.description`)},null,8,[`modelValue`,`label`,`description`]),u(v(C),{modelValue:v(q),"onUpdate:modelValue":n[3]||=e=>f(q)?q.value=e:null,label:v(p)(`settings.pages.card.creator_notes`),"single-line":!1,description:v(p)(`settings.pages.card.creation.fields_info.notes`)},null,8,[`modelValue`,`label`,`description`])])])):k.value===`behavior`?(h(),c(`div`,ue,[a(`div`,de,[u(v(C),{modelValue:v(J),"onUpdate:modelValue":n[4]||=e=>f(J)?J.value=e:null,label:v(p)(`settings.pages.card.personality`),"single-line":!1,required:!0,description:v(p)(`settings.pages.card.creation.fields_info.personality`)},null,8,[`modelValue`,`label`,`description`]),u(v(C),{modelValue:v(Y),"onUpdate:modelValue":n[5]||=e=>f(Y)?Y.value=e:null,label:v(p)(`settings.pages.card.scenario`),"single-line":!1,required:!0,description:v(p)(`settings.pages.card.creation.fields_info.scenario`)},null,8,[`modelValue`,`label`,`description`]),u(v(re),{modelValue:X.value,"onUpdate:modelValue":n[6]||=e=>X.value=e,label:v(p)(`settings.pages.card.creation.greetings`),description:v(p)(`settings.pages.card.creation.fields_info.greetings`)},null,8,[`modelValue`,`label`,`description`])])])):k.value===`settings`?(h(),c(`div`,fe,[a(`div`,pe,[u(v(C),{modelValue:v(Q),"onUpdate:modelValue":n[7]||=e=>f(Q)?Q.value=e:null,label:v(p)(`settings.pages.card.systemprompt`),"single-line":!1,required:!0,description:v(p)(`settings.pages.card.creation.fields_info.systemprompt`)},null,8,[`modelValue`,`label`,`description`]),u(v(C),{modelValue:v($),"onUpdate:modelValue":n[8]||=e=>f($)?$.value=e:null,label:v(p)(`settings.pages.card.posthistoryinstructions`),"single-line":!1,required:!0,description:v(p)(`settings.pages.card.creation.fields_info.posthistoryinstructions`)},null,8,[`modelValue`,`label`,`description`]),u(v(C),{modelValue:v(Z),"onUpdate:modelValue":n[9]||=e=>f(Z)?Z.value=e:null,label:v(p)(`settings.pages.card.creation.version`),required:!0,description:v(p)(`settings.pages.card.creation.fields_info.version`)},null,8,[`modelValue`,`label`,`description`])])])):s(``,!0),a(`div`,me,[u(v(S),{variant:`secondary`,icon:`i-solar:undo-left-bold-duotone`,label:v(p)(`settings.pages.card.cancel`),disabled:!1,onClick:n[10]||=e=>d.value=!1},null,8,[`label`]),u(v(S),{variant:`primary`,icon:`i-solar:check-circle-bold-duotone`,label:v(p)(`settings.pages.card.creation.create`),disabled:!1,onClick:n[11]||=e=>M(N.value)},null,8,[`label`])])])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),J=n(q,[[`__scopeId`,`data-v-367e133d`]]);export{J as CardCreationDialog_default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-DOEDNVJJ.js b/assets/CardCreationDialog-DOEDNVJJ.js deleted file mode 100644 index c8f8c87da767b29e7de4cdaaa008b393da946aa9..0000000000000000000000000000000000000000 --- a/assets/CardCreationDialog-DOEDNVJJ.js +++ /dev/null @@ -1 +0,0 @@ -import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import"./dist-BziUufTI.js";import"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{CardCreationDialog_default as e}from"./CardCreationDialog-BsyNmiYp.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-DPBvL_ac.js b/assets/CardCreationDialog-DPBvL_ac.js new file mode 100644 index 0000000000000000000000000000000000000000..1a1d876a569f9550a5347ebbf3b16c4ed0e7be3e --- /dev/null +++ b/assets/CardCreationDialog-DPBvL_ac.js @@ -0,0 +1 @@ +import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import"./dist-B_AZqzk2.js";import"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{CardCreationDialog_default as e}from"./CardCreationDialog-Cv_Hyp_I.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-BCybvJ8-.js b/assets/CardDetailDialog-CONcxyTr.js similarity index 95% rename from assets/CardDetailDialog-BCybvJ8-.js rename to assets/CardDetailDialog-CONcxyTr.js index a3c7b43fc9f4a4e6317ebf3628019ca365289059..badff36d9b9d6b9557a2169e46cbc0baded81eb9 100644 --- a/assets/CardDetailDialog-BCybvJ8-.js +++ b/assets/CardDetailDialog-CONcxyTr.js @@ -1 +1 @@ -import{Fragment as e,computed as t,createBaseVNode as n,createCommentVNode as r,createElementBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,normalizeClass as c,openBlock as l,ref as u,renderList as d,storeToRefs as f,toDisplayString as p,unref as m,useI18n as ee,withCtx as h}from"./index-BSwg6FIo.js";import{useAiriCardStore as te}from"./stores-BzkLfyIH.js";import{Button_default as ne}from"./Button-AEge-Qyg.js";import{$u as g,Bu as _,Iv as re,Pu as ie,nu as ae}from"./dist-BziUufTI.js";import{DeleteCardDialog_default as oe}from"./DeleteCardDialog-DFZll3ve.js";const se={key:0,class:`w-full flex flex-col gap-5`},ce={flex:`~ col`,"gap-3":``},le={flex:`~ row`,"items-center":``,"justify-between":``},ue={flex:`~ row`,"items-center":``,"gap-2":``},de={key:0,class:`flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400`},fe={"mt-1":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},pe={"font-medium":``},me={flex:`~ row`,"gap-2":``},he={class:`mt-4`},v={class:`border-b border-neutral-200 dark:border-neutral-700`},y={class:`flex justify-center -mb-px sm:justify-start space-x-1`},b=[`onClick`],x={class:`flex items-center gap-1`},S={key:0},C=[`innerHTML`],w={key:1},T=[`innerHTML`],E={key:2},D={flex:`~ col`,"max-h-60":``,"gap-4":``,"overflow-auto":``,"pr-1":``,"sm:max-h-80":``},O={key:0,flex:`~ col`,"gap-2":``},k={"text-lg":``,"text-neutral-500":``,"font-medium":``,"dark:text-neutral-400":``},A=[`innerHTML`],j={key:3},M={grid:`~ cols-1 sm:cols-3`,"gap-4":``},N={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-1":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},P={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},F={truncate:``,"font-medium":``},I={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},ge={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},L={truncate:``,"font-medium":``},_e={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},ve={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ye={truncate:``,"font-medium":``},be={key:1,bg:`neutral-50/50 dark:neutral-900/50`,"rounded-xl":``,"p-8":``,"text-center":``,border:`~ neutral-200/50 dark:neutral-700/30`,shadow:`sm`};var R=s({__name:`CardDetailDialog`,props:{modelValue:{type:Boolean},cardId:null},emits:[`update:modelValue`],setup(s,{emit:R}){let z=s,B=R,{t:V}=ee(),H=te(),{removeCard:xe}=H,{activeCardId:U}=f(H),W=t(()=>{if(z.cardId)return H.getCard(z.cardId)}),G=t(()=>{var e,t,n,r;if(!W.value||!(!((e=W.value.extensions)==null||(e=e.airi)==null)&&e.modules))return{consciousness:``,speech:``,voice:``};let i=W.value.extensions.airi.modules;return{consciousness:(t=i.consciousness)?.model||``,speech:(n=i.speech)?.model||``,voice:(r=i.speech)?.voice_id||``}}),K=t(()=>W.value?{personality:W.value.personality,scenario:W.value.scenario,systemPrompt:W.value.systemPrompt,postHistoryInstructions:W.value.postHistoryInstructions}:{}),q=t(()=>z.cardId===U.value),J=u(!1);function Se(){J.value=!0,setTimeout(()=>{U.value=z.cardId,J.value=!1},300)}function Y(e){return e?.replace(/\{\{(.*?)\}\}/g,`{{ $1 }}`).trim()}let X=u(!1);function Ce(){W.value&&(xe(z.cardId),B(`update:modelValue`,!1)),X.value=!1}let Z=u(``),Q=t(()=>{var e,t;let n=[];return(e=W.value)?.description&&n.push({id:`description`,label:V(`settings.pages.card.description_label`),icon:`i-solar:document-text-linear`}),(t=W.value)?.notes&&n.push({id:`notes`,label:V(`settings.pages.card.creator_notes`),icon:`i-solar:notes-linear`}),Object.values(K.value).some(e=>!!e)&&n.push({id:`character`,label:V(`settings.pages.card.character`),icon:`i-solar:user-rounded-linear`}),n.push({id:`modules`,label:V(`settings.pages.card.modules`),icon:`i-solar:tuning-square-linear`}),n}),$=t({get:()=>{var e;return Q.value.find(e=>e.id===Z.value)?Z.value:(e=Q.value[0])?.id||``},set:e=>{Z.value=e}});return(t,u)=>{var f;return l(),i(e,null,[o(m(ae),{open:s.modelValue,"onUpdate:open":u[0]||=e=>B(`update:modelValue`,e)},{default:h(()=>[o(m(re),null,{default:h(()=>[o(m(g),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),o(m(ie),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:h(()=>[W.value?(l(),i(`div`,se,[n(`div`,ce,[n(`div`,le,[n(`div`,null,[n(`div`,ue,[o(m(_),{"text-2xl":``,"font-bold":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:h(()=>[a(p(W.value.name),1)]),_:1}),q.value?(l(),i(`div`,de,[u[3]||=n(`div`,{"i-solar:check-circle-bold-duotone":``,"text-xs":``},null,-1),a(` `+p(m(V)(`settings.pages.card.active_badge`)),1)])):r(``,!0)]),n(`div`,fe,[a(` v`+p(W.value.version)+` `,1),W.value.creator?(l(),i(e,{key:0},[a(` · `+p(m(V)(`settings.pages.card.created_by`))+` `,1),n(`span`,pe,p(W.value.creator),1)],64)):r(``,!0)])]),n(`div`,me,[o(m(ne),{variant:`primary`,icon:q.value?`i-solar:check-circle-bold-duotone`:`i-solar:play-circle-broken`,label:q.value?m(V)(`settings.pages.card.active`):m(V)(`settings.pages.card.activate`),disabled:q.value,class:c({"animate-pulse":J.value}),onClick:Se},null,8,[`icon`,`label`,`disabled`,`class`])])]),n(`div`,he,[n(`div`,v,[n(`div`,y,[(l(!0),i(e,null,d(Q.value,e=>(l(),i(`button`,{key:e.id,class:c([`px-4 py-2 text-sm font-medium`,[$.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>$.value=e.id},[n(`div`,x,[n(`div`,{class:c(e.icon)},null,2),a(` `+p(e.label),1)])],10,b))),128))])])]),$.value===`notes`&&W.value.notes?(l(),i(`div`,S,[n(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"text-neutral-700":``,"sm:max-h-80":``,"dark:text-neutral-300":``,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,innerHTML:Y(W.value.notes)},null,8,C)])):r(``,!0),$.value===`description`&&W.value.description?(l(),i(`div`,w,[n(`div`,{bg:`white/60 dark:black/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"sm:max-h-80":``,text:`neutral-600 dark:neutral-300`,border:`~ neutral-200/50 dark:neutral-700/30`,innerHTML:Y(W.value.description)},null,8,T)])):r(``,!0),$.value===`character`&&Object.values(K.value).some(e=>!!e)?(l(),i(`div`,E,[n(`div`,D,[(l(!0),i(e,null,d(K.value,(t,a)=>(l(),i(e,{key:a},[t?(l(),i(`div`,O,[n(`h2`,k,p(m(V)(`settings.pages.card.${a.toLowerCase()}`)),1),n(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,"max-h-none":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-3":``,"text-neutral-700":``,"dark:text-neutral-300":``,innerHTML:Y(t)},null,8,A)])):r(``,!0)],64))),128))])])):r(``,!0),$.value===`modules`?(l(),i(`div`,j,[n(`div`,M,[n(`div`,N,[n(`span`,P,[u[4]||=n(`div`,{"i-lucide:ghost":``},null,-1),a(` `+p(m(V)(`settings.pages.card.consciousness.model`)),1)]),n(`div`,F,p(G.value.consciousness??`default`),1)]),n(`div`,I,[n(`span`,ge,[u[5]||=n(`div`,{"i-lucide:mic":``},null,-1),a(` `+p(m(V)(`settings.pages.card.speech.model`)),1)]),n(`div`,L,p(G.value.speech??`default`),1)]),n(`div`,_e,[n(`span`,ve,[u[6]||=n(`div`,{"i-lucide:music":``},null,-1),a(` `+p(m(V)(`settings.pages.card.speech.voice`)),1)]),n(`div`,ye,p(G.value.voice??`default`),1)])])])):r(``,!0)])])):(l(),i(`div`,be,[u[7]||=n(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),a(` `+p(m(V)(`settings.pages.card.card_not_found`)),1)]))]),_:1})]),_:1})]),_:1},8,[`open`]),o(oe,{modelValue:X.value,"onUpdate:modelValue":u[1]||=e=>X.value=e,"card-name":(f=W.value)?.name,onConfirm:Ce,onCancel:u[2]||=e=>X.value=!1},null,8,[`modelValue`,`card-name`])],64)}}}),z=R;export{z as CardDetailDialog_default}; \ No newline at end of file +import{Fragment as e,computed as t,createBaseVNode as n,createCommentVNode as r,createElementBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,normalizeClass as c,openBlock as l,ref as u,renderList as d,storeToRefs as f,toDisplayString as p,unref as m,useI18n as ee,withCtx as h}from"./index-DKziOBM4.js";import{useAiriCardStore as te}from"./stores-zsAuCjXz.js";import{Button_default as ne}from"./Button-DdtiAfEa.js";import{$u as g,Bu as _,Iv as re,Pu as ie,nu as ae}from"./dist-B_AZqzk2.js";import{DeleteCardDialog_default as oe}from"./DeleteCardDialog-cPOegSR1.js";const se={key:0,class:`w-full flex flex-col gap-5`},ce={flex:`~ col`,"gap-3":``},le={flex:`~ row`,"items-center":``,"justify-between":``},ue={flex:`~ row`,"items-center":``,"gap-2":``},de={key:0,class:`flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400`},fe={"mt-1":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},pe={"font-medium":``},me={flex:`~ row`,"gap-2":``},he={class:`mt-4`},v={class:`border-b border-neutral-200 dark:border-neutral-700`},y={class:`flex justify-center -mb-px sm:justify-start space-x-1`},b=[`onClick`],x={class:`flex items-center gap-1`},S={key:0},C=[`innerHTML`],w={key:1},T=[`innerHTML`],E={key:2},D={flex:`~ col`,"max-h-60":``,"gap-4":``,"overflow-auto":``,"pr-1":``,"sm:max-h-80":``},O={key:0,flex:`~ col`,"gap-2":``},k={"text-lg":``,"text-neutral-500":``,"font-medium":``,"dark:text-neutral-400":``},A=[`innerHTML`],j={key:3},M={grid:`~ cols-1 sm:cols-3`,"gap-4":``},N={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-1":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},P={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},F={truncate:``,"font-medium":``},I={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},ge={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},L={truncate:``,"font-medium":``},_e={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},ve={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ye={truncate:``,"font-medium":``},be={key:1,bg:`neutral-50/50 dark:neutral-900/50`,"rounded-xl":``,"p-8":``,"text-center":``,border:`~ neutral-200/50 dark:neutral-700/30`,shadow:`sm`};var R=s({__name:`CardDetailDialog`,props:{modelValue:{type:Boolean},cardId:null},emits:[`update:modelValue`],setup(s,{emit:R}){let z=s,B=R,{t:V}=ee(),H=te(),{removeCard:xe}=H,{activeCardId:U}=f(H),W=t(()=>{if(z.cardId)return H.getCard(z.cardId)}),G=t(()=>{var e,t,n,r;if(!W.value||!(!((e=W.value.extensions)==null||(e=e.airi)==null)&&e.modules))return{consciousness:``,speech:``,voice:``};let i=W.value.extensions.airi.modules;return{consciousness:(t=i.consciousness)?.model||``,speech:(n=i.speech)?.model||``,voice:(r=i.speech)?.voice_id||``}}),K=t(()=>W.value?{personality:W.value.personality,scenario:W.value.scenario,systemPrompt:W.value.systemPrompt,postHistoryInstructions:W.value.postHistoryInstructions}:{}),q=t(()=>z.cardId===U.value),J=u(!1);function Se(){J.value=!0,setTimeout(()=>{U.value=z.cardId,J.value=!1},300)}function Y(e){return e?.replace(/\{\{(.*?)\}\}/g,`{{ $1 }}`).trim()}let X=u(!1);function Ce(){W.value&&(xe(z.cardId),B(`update:modelValue`,!1)),X.value=!1}let Z=u(``),Q=t(()=>{var e,t;let n=[];return(e=W.value)?.description&&n.push({id:`description`,label:V(`settings.pages.card.description_label`),icon:`i-solar:document-text-linear`}),(t=W.value)?.notes&&n.push({id:`notes`,label:V(`settings.pages.card.creator_notes`),icon:`i-solar:notes-linear`}),Object.values(K.value).some(e=>!!e)&&n.push({id:`character`,label:V(`settings.pages.card.character`),icon:`i-solar:user-rounded-linear`}),n.push({id:`modules`,label:V(`settings.pages.card.modules`),icon:`i-solar:tuning-square-linear`}),n}),$=t({get:()=>{var e;return Q.value.find(e=>e.id===Z.value)?Z.value:(e=Q.value[0])?.id||``},set:e=>{Z.value=e}});return(t,u)=>{var f;return l(),i(e,null,[o(m(ae),{open:s.modelValue,"onUpdate:open":u[0]||=e=>B(`update:modelValue`,e)},{default:h(()=>[o(m(re),null,{default:h(()=>[o(m(g),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),o(m(ie),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:h(()=>[W.value?(l(),i(`div`,se,[n(`div`,ce,[n(`div`,le,[n(`div`,null,[n(`div`,ue,[o(m(_),{"text-2xl":``,"font-bold":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:h(()=>[a(p(W.value.name),1)]),_:1}),q.value?(l(),i(`div`,de,[u[3]||=n(`div`,{"i-solar:check-circle-bold-duotone":``,"text-xs":``},null,-1),a(` `+p(m(V)(`settings.pages.card.active_badge`)),1)])):r(``,!0)]),n(`div`,fe,[a(` v`+p(W.value.version)+` `,1),W.value.creator?(l(),i(e,{key:0},[a(` · `+p(m(V)(`settings.pages.card.created_by`))+` `,1),n(`span`,pe,p(W.value.creator),1)],64)):r(``,!0)])]),n(`div`,me,[o(m(ne),{variant:`primary`,icon:q.value?`i-solar:check-circle-bold-duotone`:`i-solar:play-circle-broken`,label:q.value?m(V)(`settings.pages.card.active`):m(V)(`settings.pages.card.activate`),disabled:q.value,class:c({"animate-pulse":J.value}),onClick:Se},null,8,[`icon`,`label`,`disabled`,`class`])])]),n(`div`,he,[n(`div`,v,[n(`div`,y,[(l(!0),i(e,null,d(Q.value,e=>(l(),i(`button`,{key:e.id,class:c([`px-4 py-2 text-sm font-medium`,[$.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>$.value=e.id},[n(`div`,x,[n(`div`,{class:c(e.icon)},null,2),a(` `+p(e.label),1)])],10,b))),128))])])]),$.value===`notes`&&W.value.notes?(l(),i(`div`,S,[n(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"text-neutral-700":``,"sm:max-h-80":``,"dark:text-neutral-300":``,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,innerHTML:Y(W.value.notes)},null,8,C)])):r(``,!0),$.value===`description`&&W.value.description?(l(),i(`div`,w,[n(`div`,{bg:`white/60 dark:black/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"sm:max-h-80":``,text:`neutral-600 dark:neutral-300`,border:`~ neutral-200/50 dark:neutral-700/30`,innerHTML:Y(W.value.description)},null,8,T)])):r(``,!0),$.value===`character`&&Object.values(K.value).some(e=>!!e)?(l(),i(`div`,E,[n(`div`,D,[(l(!0),i(e,null,d(K.value,(t,a)=>(l(),i(e,{key:a},[t?(l(),i(`div`,O,[n(`h2`,k,p(m(V)(`settings.pages.card.${a.toLowerCase()}`)),1),n(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,"max-h-none":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-3":``,"text-neutral-700":``,"dark:text-neutral-300":``,innerHTML:Y(t)},null,8,A)])):r(``,!0)],64))),128))])])):r(``,!0),$.value===`modules`?(l(),i(`div`,j,[n(`div`,M,[n(`div`,N,[n(`span`,P,[u[4]||=n(`div`,{"i-lucide:ghost":``},null,-1),a(` `+p(m(V)(`settings.pages.card.consciousness.model`)),1)]),n(`div`,F,p(G.value.consciousness??`default`),1)]),n(`div`,I,[n(`span`,ge,[u[5]||=n(`div`,{"i-lucide:mic":``},null,-1),a(` `+p(m(V)(`settings.pages.card.speech.model`)),1)]),n(`div`,L,p(G.value.speech??`default`),1)]),n(`div`,_e,[n(`span`,ve,[u[6]||=n(`div`,{"i-lucide:music":``},null,-1),a(` `+p(m(V)(`settings.pages.card.speech.voice`)),1)]),n(`div`,ye,p(G.value.voice??`default`),1)])])])):r(``,!0)])])):(l(),i(`div`,be,[u[7]||=n(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),a(` `+p(m(V)(`settings.pages.card.card_not_found`)),1)]))]),_:1})]),_:1})]),_:1},8,[`open`]),o(oe,{modelValue:X.value,"onUpdate:modelValue":u[1]||=e=>X.value=e,"card-name":(f=W.value)?.name,onConfirm:Ce,onCancel:u[2]||=e=>X.value=!1},null,8,[`modelValue`,`card-name`])],64)}}}),z=R;export{z as CardDetailDialog_default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-DnvIbrvr.js b/assets/CardDetailDialog-DnvIbrvr.js new file mode 100644 index 0000000000000000000000000000000000000000..b91d54cc12fa607b50ea3aa3dc679af76a725470 --- /dev/null +++ b/assets/CardDetailDialog-DnvIbrvr.js @@ -0,0 +1 @@ +import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import"./dist-B_AZqzk2.js";import"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import"./DeleteCardDialog-cPOegSR1.js";import{CardDetailDialog_default as e}from"./CardDetailDialog-CONcxyTr.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-McUMnIHp.js b/assets/CardDetailDialog-McUMnIHp.js deleted file mode 100644 index f446c1ecb06ac1b381c580fc459c7c917824208e..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-McUMnIHp.js +++ /dev/null @@ -1 +0,0 @@ -import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import"./dist-BziUufTI.js";import"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import"./DeleteCardDialog-DFZll3ve.js";import{CardDetailDialog_default as e}from"./CardDetailDialog-BCybvJ8-.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-BpM5aZB-.js b/assets/CardListItem-BpM5aZB-.js new file mode 100644 index 0000000000000000000000000000000000000000..01c7bcdf3b137920d4a6949472d68627eb96ab92 --- /dev/null +++ b/assets/CardListItem-BpM5aZB-.js @@ -0,0 +1 @@ +import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{CardListItem_default as e}from"./CardListItem-Df8jJDtb.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-C9XT5lUo.js b/assets/CardListItem-Df8jJDtb.js similarity index 96% rename from assets/CardListItem-C9XT5lUo.js rename to assets/CardListItem-Df8jJDtb.js index e4b3c460248f9e285e3c08bbdeff5a7496fcbf04..54d7b1bedc0ce4e5c1c1614468b9e85665fe2644 100644 --- a/assets/CardListItem-C9XT5lUo.js +++ b/assets/CardListItem-Df8jJDtb.js @@ -1 +1 @@ -import{createBaseVNode as e,createBlock as t,createCommentVNode as n,createElementBlock as r,defineComponent as i,normalizeClass as a,openBlock as o,toDisplayString as s,unref as c,withCtx as l,withModifiers as u}from"./index-BSwg6FIo.js";import{CursorFloating_default as d}from"./components-DetbLrEi.js";const f={relative:``,flex:`~ col 1`,"justify-between":``,"gap-3":``,"overflow-hidden":``,"rounded-lg":``,bg:`white dark:neutral-900`,"p-5":``,transition:`all ease-in-out duration-400`,after:`content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out`,hover:`after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80`},p={"z-1":``,flex:``,"items-start":``,"justify-between":``,"gap-2":``},m={"flex-1":``,truncate:``,"text-lg":``,"font-thin":``},h={key:0,"shrink-0":``,"rounded-md":``,"p-1":``,bg:`primary-100 dark:primary-900/40`,text:`primary-600 dark:primary-400`},g={key:0,"line-clamp-3":``,"min-h-40px":``,"flex-1":``,"text-sm":``,text:`neutral-500 dark:neutral-400`},_={"z-1":``,flex:``,"items-center":``,"justify-between":``,"text-xs":``,text:`neutral-500 dark:neutral-400`},v={flex:``,"items-center":``,"gap-1.5":``},y={flex:``,"items-center":``,"gap-0.5":``},b={flex:``,"items-center":``,"gap-0.5":``},x={flex:``,"items-center":``,"justify-end":``,"px-2":``,"py-1.5":``},S=[`disabled`];var C=i({__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(i,{emit:C}){let w=C;return(C,T)=>(o(),t(c(d),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:a([i.isSelected?`border-2 border-primary-400 dark:border-primary-600`:`border-2 border-neutral-100 dark:border-neutral-800/25`]),bg:`neutral-200/50 dark:neutral-800/50`,"drop-shadow":`none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none`,transition:`all ease-in-out duration-400`,before:`content-empty absolute inset-0 z-0 w-25% h-full transition-all duration-400 ease-in-out bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0 mask-image-[linear-gradient(120deg,white_100%)] opacity-0`,hover:`before:opacity-100 before:bg-gradient-to-r before:from-primary-500/20 before:via-primary-500/10 before:to-transparent before:dark:from-primary-400/20 before:dark:via-primary-400/10 before:dark:to-transparent`,onClick:T[2]||=e=>w(`select`)},{default:l(()=>[e(`div`,f,[e(`div`,p,[e(`h3`,m,s(i.name),1),i.isActive?(o(),r(`div`,h,T[3]||=[e(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)])):n(``,!0)]),i.description?(o(),r(`p`,g,s(i.description),1)):n(``,!0),e(`div`,_,[e(`div`,null,`v`+s(i.version),1),e(`div`,v,[e(`div`,y,[T[4]||=e(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),e(`span`,null,s(i.consciousnessModel),1)]),e(`div`,b,[T[5]||=e(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),e(`span`,null,s(i.voiceModel),1)])])])]),e(`div`,x,[e(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:i.isActive,onClick:T[0]||=u(e=>w(`activate`),[`stop`])},[e(`div`,{class:a([i.isActive?`i-solar:check-circle-bold-duotone text-primary-500 dark:text-primary-400`:`i-solar:play-circle-broken text-neutral-500 dark:text-neutral-400`])},null,2)],8,S),i.id===`default`?n(``,!0):(o(),r(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:T[1]||=u(e=>w(`delete`),[`stop`])},T[6]||=[e(`div`,{"i-solar:trash-bin-trash-linear":``,text:`neutral-500 dark:neutral-400`},null,-1)]))])]),_:1},8,[`class`]))}}),w=C;export{w as CardListItem_default}; \ No newline at end of file +import{createBaseVNode as e,createBlock as t,createCommentVNode as n,createElementBlock as r,defineComponent as i,normalizeClass as a,openBlock as o,toDisplayString as s,unref as c,withCtx as l,withModifiers as u}from"./index-DKziOBM4.js";import{CursorFloating_default as d}from"./components-BvWgWMX4.js";const f={relative:``,flex:`~ col 1`,"justify-between":``,"gap-3":``,"overflow-hidden":``,"rounded-lg":``,bg:`white dark:neutral-900`,"p-5":``,transition:`all ease-in-out duration-400`,after:`content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out`,hover:`after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80`},p={"z-1":``,flex:``,"items-start":``,"justify-between":``,"gap-2":``},m={"flex-1":``,truncate:``,"text-lg":``,"font-thin":``},h={key:0,"shrink-0":``,"rounded-md":``,"p-1":``,bg:`primary-100 dark:primary-900/40`,text:`primary-600 dark:primary-400`},g={key:0,"line-clamp-3":``,"min-h-40px":``,"flex-1":``,"text-sm":``,text:`neutral-500 dark:neutral-400`},_={"z-1":``,flex:``,"items-center":``,"justify-between":``,"text-xs":``,text:`neutral-500 dark:neutral-400`},v={flex:``,"items-center":``,"gap-1.5":``},y={flex:``,"items-center":``,"gap-0.5":``},b={flex:``,"items-center":``,"gap-0.5":``},x={flex:``,"items-center":``,"justify-end":``,"px-2":``,"py-1.5":``},S=[`disabled`];var C=i({__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(i,{emit:C}){let w=C;return(C,T)=>(o(),t(c(d),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:a([i.isSelected?`border-2 border-primary-400 dark:border-primary-600`:`border-2 border-neutral-100 dark:border-neutral-800/25`]),bg:`neutral-200/50 dark:neutral-800/50`,"drop-shadow":`none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none`,transition:`all ease-in-out duration-400`,before:`content-empty absolute inset-0 z-0 w-25% h-full transition-all duration-400 ease-in-out bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0 mask-image-[linear-gradient(120deg,white_100%)] opacity-0`,hover:`before:opacity-100 before:bg-gradient-to-r before:from-primary-500/20 before:via-primary-500/10 before:to-transparent before:dark:from-primary-400/20 before:dark:via-primary-400/10 before:dark:to-transparent`,onClick:T[2]||=e=>w(`select`)},{default:l(()=>[e(`div`,f,[e(`div`,p,[e(`h3`,m,s(i.name),1),i.isActive?(o(),r(`div`,h,T[3]||=[e(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)])):n(``,!0)]),i.description?(o(),r(`p`,g,s(i.description),1)):n(``,!0),e(`div`,_,[e(`div`,null,`v`+s(i.version),1),e(`div`,v,[e(`div`,y,[T[4]||=e(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),e(`span`,null,s(i.consciousnessModel),1)]),e(`div`,b,[T[5]||=e(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),e(`span`,null,s(i.voiceModel),1)])])])]),e(`div`,x,[e(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:i.isActive,onClick:T[0]||=u(e=>w(`activate`),[`stop`])},[e(`div`,{class:a([i.isActive?`i-solar:check-circle-bold-duotone text-primary-500 dark:text-primary-400`:`i-solar:play-circle-broken text-neutral-500 dark:text-neutral-400`])},null,2)],8,S),i.id===`default`?n(``,!0):(o(),r(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:T[1]||=u(e=>w(`delete`),[`stop`])},T[6]||=[e(`div`,{"i-solar:trash-bin-trash-linear":``,text:`neutral-500 dark:neutral-400`},null,-1)]))])]),_:1},8,[`class`]))}}),w=C;export{w as CardListItem_default}; \ No newline at end of file diff --git a/assets/CardListItem-KoeisllI.js b/assets/CardListItem-KoeisllI.js deleted file mode 100644 index 5a44c704d78c74f460631c0d00c0bc716f0390ba..0000000000000000000000000000000000000000 --- a/assets/CardListItem-KoeisllI.js +++ /dev/null @@ -1 +0,0 @@ -import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{CardListItem_default as e}from"./CardListItem-C9XT5lUo.js";export{e as default}; \ No newline at end of file diff --git a/assets/CheckBar-eDXKHwAa.js b/assets/CheckBar-CLfRTriv.js similarity index 95% rename from assets/CheckBar-eDXKHwAa.js rename to assets/CheckBar-CLfRTriv.js index d417821b78e4578b977f062f7ca5a071e103ff81..fe8d312bc888ddfbfa921614876f08b6c269c225 100644 --- a/assets/CheckBar-eDXKHwAa.js +++ b/assets/CheckBar-CLfRTriv.js @@ -1 +1 @@ -import{Transition as e,createBaseVNode as t,createCommentVNode as n,createElementBlock as r,createTextVNode as i,createVNode as a,defineComponent as o,mergeModels as s,normalizeClass as c,openBlock as l,toDisplayString as u,useModel as d,vModelCheckbox as f,withCtx as p,withDirectives as m}from"./index-BSwg6FIo.js";const h={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`},g=[`aria-checked`],_={key:0,text:`sm neutral-500`};var v=o({__name:`CheckBar`,props:s({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(o){let s=d(o,`modelValue`);return(d,v)=>(l(),r(`label`,h,[m(t(`input`,{"onUpdate:modelValue":v[0]||=e=>s.value=e,"aria-checked":s.value,type:`checkbox`,hidden:``},null,8,g),[[f,s.value]]),t(`div`,null,[i(u(d.$t(o.text))+` `,1),o.description?(l(),r(`div`,_,u(d.$t(o.description)),1)):n(``,!0)]),a(e,{name:`slide-away`,mode:`out-in`},{default:p(()=>[s.value?(l(),r(`div`,{key:0,class:c(o.iconOn),transition:`all ease-in-out duration-250`},null,2)):(l(),r(`div`,{key:1,class:c(o.iconOff),transition:`all ease-in-out duration-250`},null,2))]),_:1})]))}}),y=v;export{y as CheckBar_default}; \ No newline at end of file +import{Transition as e,createBaseVNode as t,createCommentVNode as n,createElementBlock as r,createTextVNode as i,createVNode as a,defineComponent as o,mergeModels as s,normalizeClass as c,openBlock as l,toDisplayString as u,useModel as d,vModelCheckbox as f,withCtx as p,withDirectives as m}from"./index-DKziOBM4.js";const h={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`},g=[`aria-checked`],_={key:0,text:`sm neutral-500`};var v=o({__name:`CheckBar`,props:s({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(o){let s=d(o,`modelValue`);return(d,v)=>(l(),r(`label`,h,[m(t(`input`,{"onUpdate:modelValue":v[0]||=e=>s.value=e,"aria-checked":s.value,type:`checkbox`,hidden:``},null,8,g),[[f,s.value]]),t(`div`,null,[i(u(d.$t(o.text))+` `,1),o.description?(l(),r(`div`,_,u(d.$t(o.description)),1)):n(``,!0)]),a(e,{name:`slide-away`,mode:`out-in`},{default:p(()=>[s.value?(l(),r(`div`,{key:0,class:c(o.iconOn),transition:`all ease-in-out duration-250`},null,2)):(l(),r(`div`,{key:1,class:c(o.iconOff),transition:`all ease-in-out duration-250`},null,2))]),_:1})]))}}),y=v;export{y as CheckBar_default}; \ No newline at end of file diff --git a/assets/ColorPalette-BdHvvd1C.js b/assets/ColorPalette-BB1UoLey.js similarity index 90% rename from assets/ColorPalette-BdHvvd1C.js rename to assets/ColorPalette-BB1UoLey.js index 6959a5f5f51b4acfd235c61370c2ca67a5b881f8..021d005454238d3944aded5573afb572bd8553ef 100644 --- a/assets/ColorPalette-BdHvvd1C.js +++ b/assets/ColorPalette-BB1UoLey.js @@ -1 +1 @@ -import{DEFAULT_THEME_COLORS_HUE as e,Fragment as t,createBlock as n,createCommentVNode as r,createElementBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,normalizeClass as c,normalizeStyle as l,openBlock as u,renderList as d,toDisplayString as f,unref as p,useSettings as m,withCtx as h}from"./index-BSwg6FIo.js";import{Gg as g,Hg as _,Ug as v,Wg as y,jg as b,qg as x}from"./dist-BziUufTI.js";const S={key:0,flex:``,"gap-2":``};var C=s({__name:`ColorPalette`,props:{colors:null},setup(s){let C=m();return(m,w)=>s.colors.length?(u(),i(`div`,S,[(u(!0),i(t,null,d(s.colors,({hex:t,name:r})=>(u(),n(p(_),{key:t||`default`},{default:h(()=>[o(p(y),null,{default:h(()=>[o(p(b),{transition:`all ease-in-out duration-250`,"size-6":``,"cursor-pointer":``,"rounded-full":``,"bg-primary-500":``,style:l(t?{background:t}:{"--chromatic-hue":p(e)}),class:c(p(C).isColorSelectedForPrimary(t)?`scale-150 mx-1`:`hover:scale-110`),onClick:e=>p(C).applyPrimaryColorFrom(t)},null,8,[`style`,`class`,`onClick`]),o(p(x),null,{default:h(()=>[o(p(v),{bg:`white dark:neutral-800`,"rounded-lg":``,"px-3":``,"py-1.5":``,"text-sm":``,"shadow-md":``},{default:h(()=>[a(f(r)+` `,1),o(p(g),{"fill-white":``,"dark:fill-neutral-800":``})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):r(``,!0)}}),w=C;export{w as ColorPalette_default}; \ No newline at end of file +import{DEFAULT_THEME_COLORS_HUE as e,Fragment as t,createBlock as n,createCommentVNode as r,createElementBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,normalizeClass as c,normalizeStyle as l,openBlock as u,renderList as d,toDisplayString as f,unref as p,useSettings as m,withCtx as h}from"./index-DKziOBM4.js";import{Gg as g,Hg as _,Ug as v,Wg as y,jg as b,qg as x}from"./dist-B_AZqzk2.js";const S={key:0,flex:``,"gap-2":``};var C=s({__name:`ColorPalette`,props:{colors:null},setup(s){let C=m();return(m,w)=>s.colors.length?(u(),i(`div`,S,[(u(!0),i(t,null,d(s.colors,({hex:t,name:r})=>(u(),n(p(_),{key:t||`default`},{default:h(()=>[o(p(y),null,{default:h(()=>[o(p(b),{transition:`all ease-in-out duration-250`,"size-6":``,"cursor-pointer":``,"rounded-full":``,"bg-primary-500":``,style:l(t?{background:t}:{"--chromatic-hue":p(e)}),class:c(p(C).isColorSelectedForPrimary(t)?`scale-150 mx-1`:`hover:scale-110`),onClick:e=>p(C).applyPrimaryColorFrom(t)},null,8,[`style`,`class`,`onClick`]),o(p(x),null,{default:h(()=>[o(p(v),{bg:`white dark:neutral-800`,"rounded-lg":``,"px-3":``,"py-1.5":``,"text-sm":``,"shadow-md":``},{default:h(()=>[a(f(r)+` `,1),o(p(g),{"fill-white":``,"dark:fill-neutral-800":``})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):r(``,!0)}}),w=C;export{w as ColorPalette_default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-BoKcjVsa.js b/assets/DeleteCardDialog-BoKcjVsa.js new file mode 100644 index 0000000000000000000000000000000000000000..e2c4e7fd2b32ba4da437af9588c34022b5502c41 --- /dev/null +++ b/assets/DeleteCardDialog-BoKcjVsa.js @@ -0,0 +1 @@ +import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import"./dist-B_AZqzk2.js";import{DeleteCardDialog_default as e}from"./DeleteCardDialog-cPOegSR1.js";export{e as default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-ChdXAy_R.js b/assets/DeleteCardDialog-ChdXAy_R.js deleted file mode 100644 index 9cf70ef4c806ec5918865ab9c2af7cb52c78012f..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-ChdXAy_R.js +++ /dev/null @@ -1 +0,0 @@ -import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import"./dist-BziUufTI.js";import{DeleteCardDialog_default as e}from"./DeleteCardDialog-DFZll3ve.js";export{e as default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-DFZll3ve.js b/assets/DeleteCardDialog-cPOegSR1.js similarity index 89% rename from assets/DeleteCardDialog-DFZll3ve.js rename to assets/DeleteCardDialog-cPOegSR1.js index 6fb7e38ce495ca177302bd3e7aef9a7f6170e188..be3bcf5b7356e51023ef0ddf2647e9985a7ce309 100644 --- a/assets/DeleteCardDialog-DFZll3ve.js +++ b/assets/DeleteCardDialog-cPOegSR1.js @@ -1 +1 @@ -import{createBaseVNode as e,createBlock as t,createTextVNode as n,createVNode as r,defineComponent as i,openBlock as a,toDisplayString as o,unref as s,useI18n as c,withCtx as l}from"./index-BSwg6FIo.js";import{Button_default as u}from"./Button-AEge-Qyg.js";import{Av as d,Fv as f,Mv as p,Nv as m,Ov as h,Tv as g,Vv as _,kv as v}from"./dist-BziUufTI.js";const y={class:`flex flex-row justify-end gap-3`};var b=i({__name:`DeleteCardDialog`,props:{modelValue:{type:Boolean},cardName:null},emits:[`update:modelValue`,`confirm`,`cancel`],setup(i,{emit:b}){let x=b,{t:S}=c();function C(){x(`update:modelValue`,!1),x(`cancel`)}function w(){x(`update:modelValue`,!1),x(`confirm`)}return(c,b)=>(a(),t(s(g),{open:i.modelValue,"onUpdate:open":b[0]||=e=>x(`update:modelValue`,e)},{default:l(()=>[r(s(d),null,{default:l(()=>[r(s(v),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50`}),r(s(h),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800`},{default:l(()=>[r(s(_),{class:`mb-4 text-xl font-bold`},{default:l(()=>[n(o(s(S)(`settings.pages.card.delete_card`)),1)]),_:1}),r(s(f),{class:`mb-6`},{default:l(()=>[n(o(s(S)(`settings.pages.card.delete_confirmation`))+` `,1),e(`b`,null,`"`+o(i.cardName||``)+`"`,1)]),_:1}),e(`div`,y,[r(s(p),{"as-child":``},{default:l(()=>[r(s(u),{variant:`secondary`,label:s(S)(`settings.pages.card.cancel`),onClick:C},null,8,[`label`])]),_:1}),r(s(m),{"as-child":``},{default:l(()=>[r(s(u),{variant:`danger`,label:s(S)(`settings.pages.card.delete`),onClick:w},null,8,[`label`])]),_:1})])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),x=b;export{x as DeleteCardDialog_default}; \ No newline at end of file +import{createBaseVNode as e,createBlock as t,createTextVNode as n,createVNode as r,defineComponent as i,openBlock as a,toDisplayString as o,unref as s,useI18n as c,withCtx as l}from"./index-DKziOBM4.js";import{Button_default as u}from"./Button-DdtiAfEa.js";import{Av as d,Fv as f,Mv as p,Nv as m,Ov as h,Tv as g,Vv as _,kv as v}from"./dist-B_AZqzk2.js";const y={class:`flex flex-row justify-end gap-3`};var b=i({__name:`DeleteCardDialog`,props:{modelValue:{type:Boolean},cardName:null},emits:[`update:modelValue`,`confirm`,`cancel`],setup(i,{emit:b}){let x=b,{t:S}=c();function C(){x(`update:modelValue`,!1),x(`cancel`)}function w(){x(`update:modelValue`,!1),x(`confirm`)}return(c,b)=>(a(),t(s(g),{open:i.modelValue,"onUpdate:open":b[0]||=e=>x(`update:modelValue`,e)},{default:l(()=>[r(s(d),null,{default:l(()=>[r(s(v),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50`}),r(s(h),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800`},{default:l(()=>[r(s(_),{class:`mb-4 text-xl font-bold`},{default:l(()=>[n(o(s(S)(`settings.pages.card.delete_card`)),1)]),_:1}),r(s(f),{class:`mb-6`},{default:l(()=>[n(o(s(S)(`settings.pages.card.delete_confirmation`))+` `,1),e(`b`,null,`"`+o(i.cardName||``)+`"`,1)]),_:1}),e(`div`,y,[r(s(p),{"as-child":``},{default:l(()=>[r(s(u),{variant:`secondary`,label:s(S)(`settings.pages.card.cancel`),onClick:C},null,8,[`label`])]),_:1}),r(s(m),{"as-child":``},{default:l(()=>[r(s(u),{variant:`danger`,label:s(S)(`settings.pages.card.delete`),onClick:w},null,8,[`label`])]),_:1})])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),x=b;export{x as DeleteCardDialog_default}; \ No newline at end of file diff --git a/assets/HeaderLink-rfbghXs_.js b/assets/HeaderLink-vGMDgqa7.js similarity index 92% rename from assets/HeaderLink-rfbghXs_.js rename to assets/HeaderLink-vGMDgqa7.js index 796e63aaf84c1ef26409ec40ed30fb9def40a47f..199d6e9909612b0782f16d303e6dd78432a47a49 100644 --- a/assets/HeaderLink-rfbghXs_.js +++ b/assets/HeaderLink-vGMDgqa7.js @@ -1 +1 @@ -import{RouterLink as e,__plugin_vue_export_helper_default as t,createBaseVNode as n,createBlock as r,createElementBlock as i,defineComponent as a,openBlock as o,unref as s,useDark as c,withCtx as l}from"./index-BSwg6FIo.js";var u=`/assets/logo-dark-B0bvNYTh.svg`,d=`/assets/logo-B2aCU-bH.svg`;const f=[`src`],p=[`src`];var m=a({__name:`HeaderLink`,setup(t){let a=c();return(t,c)=>(o(),r(s(e),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:l(()=>[s(a)?(o(),i(`img`,{key:0,src:s(u),"h-8":``,"w-8":``,class:`theme-colored`},null,8,f)):(o(),i(`img`,{key:1,src:s(d),"h-8":``,"w-8":``,class:`theme-colored`},null,8,p)),c[0]||=n(`div`,{"translate-y":`[2px]`,"font-semibold":``,"font-quicksand":``},[n(`span`,null,`AIRI`)],-1)]),_:1,__:[0]}))}}),h=t(m,[[`__scopeId`,`data-v-2542c9d9`]]);export{h as HeaderLink_default}; \ No newline at end of file +import{RouterLink as e,__plugin_vue_export_helper_default as t,createBaseVNode as n,createBlock as r,createElementBlock as i,defineComponent as a,openBlock as o,unref as s,useDark as c,withCtx as l}from"./index-DKziOBM4.js";var u=`/assets/logo-dark-B0bvNYTh.svg`,d=`/assets/logo-B2aCU-bH.svg`;const f=[`src`],p=[`src`];var m=a({__name:`HeaderLink`,setup(t){let a=c();return(t,c)=>(o(),r(s(e),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:l(()=>[s(a)?(o(),i(`img`,{key:0,src:s(u),"h-8":``,"w-8":``,class:`theme-colored`},null,8,f)):(o(),i(`img`,{key:1,src:s(d),"h-8":``,"w-8":``,class:`theme-colored`},null,8,p)),c[0]||=n(`div`,{"translate-y":`[2px]`,"font-semibold":``,"font-quicksand":``},[n(`span`,null,`AIRI`)],-1)]),_:1,__:[0]}))}}),h=t(m,[[`__scopeId`,`data-v-2542c9d9`]]);export{h as HeaderLink_default}; \ No newline at end of file diff --git a/assets/IconAnimation-LJjhLEIS.js b/assets/IconAnimation-D-xhKJXy.js similarity index 95% rename from assets/IconAnimation-LJjhLEIS.js rename to assets/IconAnimation-D-xhKJXy.js index 36a60eaaeacc5511f483c9dd53e9a8492d48b9f4..f7dcc8b2414b5d6c206f92e0a37bf3e138d9869d 100644 --- a/assets/IconAnimation-LJjhLEIS.js +++ b/assets/IconAnimation-D-xhKJXy.js @@ -1 +1 @@ -import{computed as e,createBaseVNode as t,createElementBlock as n,defineComponent as r,normalizeClass as i,normalizeStyle as a,openBlock as o,ref as s,watch as c}from"./index-BSwg6FIo.js";var l=r({__name:`IconAnimation`,props:{icon:null,iconSize:null,position:null,duration:null,started:{type:Boolean},textColor:null,isReverse:{type:Boolean},zIndex:null},emits:[`animationEnded`],setup(r,{emit:l}){let u=r,d=l,f=s(!1);c(()=>u.started,e=>{e&&requestAnimationFrame(()=>{f.value=!0})});let p=e(()=>({opacity:f.value===u.isReverse?0:1,size:f.value===u.isReverse?u.iconSize:25,position:f.value===u.isReverse?u.position:`calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)`,textColor:f.value===u.isReverse?u.textColor:`text-white`})),m=s([]),h=s(!1);function g(e){m.value.push(e.propertyName),m.value.includes(`color`)&&m.value.includes(`width`)&&m.value.includes(`height`)&&m.value.includes(`transform`)&&(h.value=!0,d(`animationEnded`))}return(e,s)=>(o(),n(`div`,{"pointer-events-none":``,fixed:``,w:`100dvw`,h:`100dvh`,style:a({zIndex:h.value?r.zIndex:void 0})},[t(`div`,{fixed:``,"inset-0":``,"bg-primary-500":``,"transition-opacity":``,"ease-linear":``,style:a({opacity:p.value.opacity,transitionDuration:`${r.duration}ms`})},null,4),t(`div`,{fixed:``,"inset-0":``,"ease-in-out":``,style:a({width:`${p.value.size}rem`,height:`${p.value.size}rem`,transform:`translate(${p.value.position})`,transitionDuration:`${r.duration}ms`}),class:i([p.value.textColor,u.icon,{"transition-all":f.value}]),onTransitionend:g},null,38)],4))}}),u=l;export{u as IconAnimation_default}; \ No newline at end of file +import{computed as e,createBaseVNode as t,createElementBlock as n,defineComponent as r,normalizeClass as i,normalizeStyle as a,openBlock as o,ref as s,watch as c}from"./index-DKziOBM4.js";var l=r({__name:`IconAnimation`,props:{icon:null,iconSize:null,position:null,duration:null,started:{type:Boolean},textColor:null,isReverse:{type:Boolean},zIndex:null},emits:[`animationEnded`],setup(r,{emit:l}){let u=r,d=l,f=s(!1);c(()=>u.started,e=>{e&&requestAnimationFrame(()=>{f.value=!0})});let p=e(()=>({opacity:f.value===u.isReverse?0:1,size:f.value===u.isReverse?u.iconSize:25,position:f.value===u.isReverse?u.position:`calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)`,textColor:f.value===u.isReverse?u.textColor:`text-white`})),m=s([]),h=s(!1);function g(e){m.value.push(e.propertyName),m.value.includes(`color`)&&m.value.includes(`width`)&&m.value.includes(`height`)&&m.value.includes(`transform`)&&(h.value=!0,d(`animationEnded`))}return(e,s)=>(o(),n(`div`,{"pointer-events-none":``,fixed:``,w:`100dvw`,h:`100dvh`,style:a({zIndex:h.value?r.zIndex:void 0})},[t(`div`,{fixed:``,"inset-0":``,"bg-primary-500":``,"transition-opacity":``,"ease-linear":``,style:a({opacity:p.value.opacity,transitionDuration:`${r.duration}ms`})},null,4),t(`div`,{fixed:``,"inset-0":``,"ease-in-out":``,style:a({width:`${p.value.size}rem`,height:`${p.value.size}rem`,transform:`translate(${p.value.position})`,transitionDuration:`${r.duration}ms`}),class:i([p.value.textColor,u.icon,{"transition-all":f.value}]),onTransitionend:g},null,38)],4))}}),u=l;export{u as IconAnimation_default}; \ No newline at end of file diff --git a/assets/InputFile-R2knYJRe.js b/assets/InputFile-DEuushJG.js similarity index 96% rename from assets/InputFile-R2knYJRe.js rename to assets/InputFile-DEuushJG.js index 15b4459ccd92e3fc8039ced202f20b3a874f0ff2..8cd8604e4f7cb66d31e0018a8bd16f5b877e7af7 100644 --- a/assets/InputFile-R2knYJRe.js +++ b/assets/InputFile-DEuushJG.js @@ -1 +1 @@ -import{createBaseVNode as e,createElementBlock as t,defineComponent as n,mergeModels as r,normalizeClass as i,openBlock as a,ref as o,refDebounced as s,renderSlot as c,unref as l,useModel as u}from"./index-BSwg6FIo.js";const d=[`accept`,`multiple`],f={key:0,text:`center`,"text-sm":``},p={key:1,text:`center`,"text-sm":``};var m=n({__name:`InputFile`,props:r({accept:null,multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(n){let r=u(n,`modelValue`),m=o(),h=o(!1),g=s(h,150);function _(e){let t=e.target;t.files&&t.files.length>0&&(m.value=t.files[0]),r.value=Array.from(t.files||[]),h.value=!1}return(o,s)=>(a(),t(`label`,{relative:``,class:i([`min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6`,[l(g)?`border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700`:`border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700`,l(g)?`bg-primary-50/5 dark:bg-primary-900/5`:`bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40`]]),border:`dashed 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`,onDragover:s[0]||=e=>h.value=!0,onDragleave:s[1]||=e=>h.value=!1},[e(`input`,{type:`file`,accept:n.accept,multiple:n.multiple,"cursor-pointer":``,class:`absolute inset-0 h-full w-full opacity-0`,onChange:_},null,40,d),c(o.$slots,`default`,{isDragging:l(g),firstFile:m.value,files:r.value},()=>[e(`div`,{class:i([`flex flex-col items-center`,[l(g)?`text-primary-500 dark:text-primary-400`:`text-neutral-400 dark:text-neutral-500`]])},[s[2]||=e(`div`,{"i-solar:upload-square-line-duotone":``,"mb-2":``,"text-5xl":``},null,-1),s[3]||=e(`p`,{"font-medium":``,text:`center lg`},` Upload `,-1),l(g)?(a(),t(`p`,f,` Release to upload `)):(a(),t(`p`,p,` Click or drag and drop a file here `))],2)])],34))}}),h=m;export{h as InputFile_default}; \ No newline at end of file +import{createBaseVNode as e,createElementBlock as t,defineComponent as n,mergeModels as r,normalizeClass as i,openBlock as a,ref as o,refDebounced as s,renderSlot as c,unref as l,useModel as u}from"./index-DKziOBM4.js";const d=[`accept`,`multiple`],f={key:0,text:`center`,"text-sm":``},p={key:1,text:`center`,"text-sm":``};var m=n({__name:`InputFile`,props:r({accept:null,multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(n){let r=u(n,`modelValue`),m=o(),h=o(!1),g=s(h,150);function _(e){let t=e.target;t.files&&t.files.length>0&&(m.value=t.files[0]),r.value=Array.from(t.files||[]),h.value=!1}return(o,s)=>(a(),t(`label`,{relative:``,class:i([`min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6`,[l(g)?`border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700`:`border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700`,l(g)?`bg-primary-50/5 dark:bg-primary-900/5`:`bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40`]]),border:`dashed 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`,onDragover:s[0]||=e=>h.value=!0,onDragleave:s[1]||=e=>h.value=!1},[e(`input`,{type:`file`,accept:n.accept,multiple:n.multiple,"cursor-pointer":``,class:`absolute inset-0 h-full w-full opacity-0`,onChange:_},null,40,d),c(o.$slots,`default`,{isDragging:l(g),firstFile:m.value,files:r.value},()=>[e(`div`,{class:i([`flex flex-col items-center`,[l(g)?`text-primary-500 dark:text-primary-400`:`text-neutral-400 dark:text-neutral-500`]])},[s[2]||=e(`div`,{"i-solar:upload-square-line-duotone":``,"mb-2":``,"text-5xl":``},null,-1),s[3]||=e(`p`,{"font-medium":``,text:`center lg`},` Upload `,-1),l(g)?(a(),t(`p`,f,` Release to upload `)):(a(),t(`p`,p,` Click or drag and drop a file here `))],2)])],34))}}),h=m;export{h as InputFile_default}; \ No newline at end of file diff --git a/assets/Textarea-CuugR8VV.js b/assets/Textarea-BIh0Stpi.js similarity index 84% rename from assets/Textarea-CuugR8VV.js rename to assets/Textarea-BIh0Stpi.js index e222e108c533b083531da7d029d3c6e0fd98aa09..ee2f956006fe89902fb081e9b714bc3c48b6b102 100644 --- a/assets/Textarea-CuugR8VV.js +++ b/assets/Textarea-BIh0Stpi.js @@ -1 +1 @@ -import{createBlock as e,defineComponent as t,openBlock as n,useModel as r}from"./index-BSwg6FIo.js";import{Basic_default as i}from"./Basic-BGRWPjtG.js";var a=t({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(t){let a=r(t,`modelValue`);return(t,r)=>(n(),e(i,{modelValue:a.value,"onUpdate:modelValue":r[0]||=e=>a.value=e,border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,8,[`modelValue`]))}}),o=a;export{o as Textarea_default}; \ No newline at end of file +import{createBlock as e,defineComponent as t,openBlock as n,useModel as r}from"./index-DKziOBM4.js";import{Basic_default as i}from"./Basic-C8g-kAol.js";var a=t({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(t){let a=r(t,`modelValue`);return(t,r)=>(n(),e(i,{modelValue:a.value,"onUpdate:modelValue":r[0]||=e=>a.value=e,border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,8,[`modelValue`]))}}),o=a;export{o as Textarea_default}; \ No newline at end of file diff --git a/assets/_...all_-B_osODv_.js b/assets/_...all_-CDWjTnYO.js similarity index 72% rename from assets/_...all_-B_osODv_.js rename to assets/_...all_-CDWjTnYO.js index 8e32378b824f4f6a34ca36248e2ac1f21288115a..5f05381a08dfec62e421568b725076c5ec2c9cc9 100644 --- a/assets/_...all_-B_osODv_.js +++ b/assets/_...all_-CDWjTnYO.js @@ -1 +1 @@ -import{__plugin_vue_export_helper_default as e,createElementBlock as t,openBlock as n}from"./index-BSwg6FIo.js";const r={};function i(e,r){return n(),t(`div`,null,` 404 - Page not found `)}var a=e(r,[[`render`,i]]);export{a as default}; \ No newline at end of file +import{__plugin_vue_export_helper_default as e,createElementBlock as t,openBlock as n}from"./index-DKziOBM4.js";const r={};function i(e,r){return n(),t(`div`,null,` 404 - Page not found `)}var a=e(r,[[`render`,i]]);export{a as default}; \ No newline at end of file diff --git a/assets/__vite-browser-external-CubORAmj.js b/assets/__vite-browser-external-Dxcx6a0k.js similarity index 59% rename from assets/__vite-browser-external-CubORAmj.js rename to assets/__vite-browser-external-Dxcx6a0k.js index 0f683d3a4d6e5b9a279b829786d7762f6a3659ff..f89d49fcaa82c386d9cd9be6003cb5967a576b1d 100644 --- a/assets/__vite-browser-external-CubORAmj.js +++ b/assets/__vite-browser-external-Dxcx6a0k.js @@ -1 +1 @@ -import{require___vite_browser_external as e}from"./__vite-browser-external-CoPuN2cl.js";export default e(); \ No newline at end of file +import{require___vite_browser_external as e}from"./__vite-browser-external-FU9M8lFq.js";export default e(); \ No newline at end of file diff --git a/assets/__vite-browser-external-CoPuN2cl.js b/assets/__vite-browser-external-FU9M8lFq.js similarity index 52% rename from assets/__vite-browser-external-CoPuN2cl.js rename to assets/__vite-browser-external-FU9M8lFq.js index fae13eaadd5cec23bcf56f8d1f75ad680d937129..b3851f51b42efc0095b1e47e0fca002aa17333db 100644 --- a/assets/__vite-browser-external-CoPuN2cl.js +++ b/assets/__vite-browser-external-FU9M8lFq.js @@ -1 +1 @@ -import{__commonJSMin as e}from"./index-BSwg6FIo.js";var t=e((exports,t)=>{t.exports={}});export{t as require___vite_browser_external}; \ No newline at end of file +import{__commonJSMin as e}from"./index-DKziOBM4.js";var t=e((exports,t)=>{t.exports={}});export{t as require___vite_browser_external}; \ No newline at end of file diff --git a/assets/airi-card-gp_HXphd.js b/assets/airi-card-B_A3U3hx.js similarity index 87% rename from assets/airi-card-gp_HXphd.js rename to assets/airi-card-B_A3U3hx.js index c8787ef609eccaa3b83ad01290be8581f253592d..26bf402ab0b700e979ec9819b491151e1cdd1e24 100644 --- a/assets/airi-card-gp_HXphd.js +++ b/assets/airi-card-B_A3U3hx.js @@ -1 +1 @@ -import{Fragment as e,computed as t,createBaseVNode as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createVNode as o,defineComponent as s,normalizeClass as c,openBlock as l,ref as u,renderList as d,resolveDirective as ee,storeToRefs as f,toDisplayString as p,unref as m,useI18n as h,vModelText as te,watch as ne,withCtx as re,withDirectives as g}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useAiriCardStore as ie}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import{Select_default as ae}from"./src-CX9nVT7I.js";import"./dist-BziUufTI.js";import{InputFile_default as _}from"./InputFile-R2knYJRe.js";import"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as v}from"./route-block-CC3cgg4Q.js";import{CardCreate_default as y}from"./CardCreate-D42uwy43.js";import{CardCreationDialog_default as b}from"./CardCreationDialog-BsyNmiYp.js";import{DeleteCardDialog_default as x}from"./DeleteCardDialog-DFZll3ve.js";import{CardDetailDialog_default as S}from"./CardDetailDialog-BCybvJ8-.js";import{CardListItem_default as oe}from"./CardListItem-C9XT5lUo.js";const se={"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},ce={flex:`~ row`,"flex-wrap":``,"items-center":``,"justify-between":``,"gap-4":``},C={class:`relative min-w-[200px] flex-1`,"inline-flex":`~`,"w-full":``,"items-center":``},w=[`placeholder`],T={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},E={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},D={key:0,flex:``,"flex-col":``,"items-center":``},O={"font-medium":``,text:`neutral-600 dark:neutral-300`},k={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},A={key:1,flex:``,"flex-col":``,"items-center":``},j={"font-medium":``,text:`primary-600 dark:primary-300`},M={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`},N={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`},P={class:`flex flex-col`},F={class:`font-medium`},I={class:`text-sm text-amber-600 dark:text-amber-400`},L={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var R=s({__name:`index`,setup(s){let{t:v}=h(),R=ie(),{addCard:z,removeCard:B}=R,{cards:V,activeCardId:H}=f(R),U=u(``),W=u(!1),G=u(!1),K=u(``),q=u(`nameAsc`),J=u([]);ne(J,async e=>{let t=e[0];if(t)try{let e=await t.text(),n=JSON.parse(e);U.value=z(n),W.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let Y=t(()=>Array.from(V.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),le=t(()=>{if(!K.value)return Y.value;let e=K.value.toLowerCase();return Y.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),X=t(()=>{let e=[...le.value];return q.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):q.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):q.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),Z=u(!1),Q=u(null);function ue(){Q.value&&(B(Q.value),Q.value=null,Z.value=!1)}function de(e){Q.value=e,Z.value=!0}function fe(e){U.value=e,W.value=!0}function pe(){G.value=!0}function me(e){H.value=e}function he(e){let t=V.value.get(e);return t?.version||`1.0.0`}function $(e,t){var n,r,i;let a=V.value.get(e);if(!a||!(!((n=a.extensions)==null||(n=n.airi)==null)&&n.modules))return`default`;let o=a.extensions.airi.modules;return t===`consciousness`?(r=o.consciousness)?.model&&o.consciousness.model.split(`-`).pop()||`default`:t===`voice`&&(i=o.speech)?.voice_id||`default`}return(t,s)=>{var u;let f=ee(`motion`);return l(),a(e,null,[n(`div`,se,[n(`div`,ce,[n(`div`,C,[s[7]||=n(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[n(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),g(n(`input`,{"onUpdate:modelValue":s[0]||=e=>K.value=e,type:`search`,class:`w-full rounded-xl p-2.5 pl-10 text-sm outline-none`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,bg:`white dark:neutral-900`,placeholder:m(v)(`settings.pages.card.search`)},null,8,w),[[te,K.value]])]),n(`div`,T,[n(`div`,E,p(m(v)(`settings.pages.card.sort_by`))+`: `,1),o(m(ae),{modelValue:q.value,"onUpdate:modelValue":s[1]||=e=>q.value=e,options:[{value:`nameAsc`,label:m(v)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:m(v)(`settings.pages.card.name_desc`)},{value:`recent`,label:m(v)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),n(`div`,{class:c([`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))]":m(V).size>0}])},[o(m(_),{modelValue:J.value,"onUpdate:modelValue":s[2]||=e=>J.value=e,accept:`*.json`},{default:re(({isDragging:e})=>[e?(l(),a(`div`,A,[s[9]||=n(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),n(`p`,j,p(m(v)(`settings.pages.card.drop_here`)),1)])):(l(),a(`div`,D,[s[8]||=n(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),n(`p`,O,p(m(v)(`settings.pages.card.upload`)),1),n(`p`,k,p(m(v)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),o(y,{onClick:pe}),m(V).size>0?(l(!0),a(e,{key:0},d(X.value,e=>(l(),r(oe,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===m(H),"is-selected":e.id===U.value&&W.value,version:he(e.id),"consciousness-model":$(e.id,`consciousness`),"voice-model":$(e.id,`voice`),onSelect:t=>fe(e.id),onActivate:t=>me(e.id),onDelete:t=>de(e.id)},null,8,[`id`,`name`,`description`,`is-active`,`is-selected`,`version`,`consciousness-model`,`voice-model`,`onSelect`,`onActivate`,`onDelete`]))),128)):i(``,!0),m(V).size===0?(l(),a(`div`,M,[s[10]||=n(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),n(`p`,null,p(m(v)(`settings.pages.card.no_cards`)),1)])):i(``,!0),K.value&&X.value.length===0?(l(),a(`div`,N,[s[11]||=n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,P,[n(`span`,F,p(m(v)(`settings.pages.card.no_results`)),1),n(`span`,I,p(m(v)(`settings.pages.card.try_different_search`)),1)])])):i(``,!0)],2)]),o(x,{modelValue:Z.value,"onUpdate:modelValue":s[3]||=e=>Z.value=e,"card-name":Q.value?(u=m(R).getCard(Q.value))?.name:``,onConfirm:ue,onCancel:s[4]||=e=>Q.value=null},null,8,[`modelValue`,`card-name`]),o(S,{modelValue:W.value,"onUpdate:modelValue":s[5]||=e=>W.value=e,"card-id":U.value},null,8,[`modelValue`,`card-id`]),o(b,{modelValue:G.value,"onUpdate:modelValue":s[6]||=e=>G.value=e},null,8,[`modelValue`]),g((l(),a(`div`,L,s[12]||=[n(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[f]])],64)}}});typeof v==`function`&&v(R);var z=R;export{z as default}; \ No newline at end of file +import{Fragment as e,computed as t,createBaseVNode as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createVNode as o,defineComponent as s,normalizeClass as c,openBlock as l,ref as u,renderList as d,resolveDirective as ee,storeToRefs as f,toDisplayString as p,unref as m,useI18n as h,vModelText as te,watch as ne,withCtx as re,withDirectives as g}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useAiriCardStore as ie}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import{Select_default as ae}from"./src-CmPNYgc5.js";import"./dist-B_AZqzk2.js";import{InputFile_default as _}from"./InputFile-DEuushJG.js";import"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as v}from"./route-block-CC3cgg4Q.js";import{CardCreate_default as y}from"./CardCreate-4reXB0pk.js";import{CardCreationDialog_default as b}from"./CardCreationDialog-Cv_Hyp_I.js";import{DeleteCardDialog_default as x}from"./DeleteCardDialog-cPOegSR1.js";import{CardDetailDialog_default as S}from"./CardDetailDialog-CONcxyTr.js";import{CardListItem_default as oe}from"./CardListItem-Df8jJDtb.js";const se={"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},ce={flex:`~ row`,"flex-wrap":``,"items-center":``,"justify-between":``,"gap-4":``},C={class:`relative min-w-[200px] flex-1`,"inline-flex":`~`,"w-full":``,"items-center":``},w=[`placeholder`],T={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},E={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},D={key:0,flex:``,"flex-col":``,"items-center":``},O={"font-medium":``,text:`neutral-600 dark:neutral-300`},k={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},A={key:1,flex:``,"flex-col":``,"items-center":``},j={"font-medium":``,text:`primary-600 dark:primary-300`},M={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`},N={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`},P={class:`flex flex-col`},F={class:`font-medium`},I={class:`text-sm text-amber-600 dark:text-amber-400`},L={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var R=s({__name:`index`,setup(s){let{t:v}=h(),R=ie(),{addCard:z,removeCard:B}=R,{cards:V,activeCardId:H}=f(R),U=u(``),W=u(!1),G=u(!1),K=u(``),q=u(`nameAsc`),J=u([]);ne(J,async e=>{let t=e[0];if(t)try{let e=await t.text(),n=JSON.parse(e);U.value=z(n),W.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let Y=t(()=>Array.from(V.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),le=t(()=>{if(!K.value)return Y.value;let e=K.value.toLowerCase();return Y.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),X=t(()=>{let e=[...le.value];return q.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):q.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):q.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),Z=u(!1),Q=u(null);function ue(){Q.value&&(B(Q.value),Q.value=null,Z.value=!1)}function de(e){Q.value=e,Z.value=!0}function fe(e){U.value=e,W.value=!0}function pe(){G.value=!0}function me(e){H.value=e}function he(e){let t=V.value.get(e);return t?.version||`1.0.0`}function $(e,t){var n,r,i;let a=V.value.get(e);if(!a||!(!((n=a.extensions)==null||(n=n.airi)==null)&&n.modules))return`default`;let o=a.extensions.airi.modules;return t===`consciousness`?(r=o.consciousness)?.model&&o.consciousness.model.split(`-`).pop()||`default`:t===`voice`&&(i=o.speech)?.voice_id||`default`}return(t,s)=>{var u;let f=ee(`motion`);return l(),a(e,null,[n(`div`,se,[n(`div`,ce,[n(`div`,C,[s[7]||=n(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[n(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),g(n(`input`,{"onUpdate:modelValue":s[0]||=e=>K.value=e,type:`search`,class:`w-full rounded-xl p-2.5 pl-10 text-sm outline-none`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,bg:`white dark:neutral-900`,placeholder:m(v)(`settings.pages.card.search`)},null,8,w),[[te,K.value]])]),n(`div`,T,[n(`div`,E,p(m(v)(`settings.pages.card.sort_by`))+`: `,1),o(m(ae),{modelValue:q.value,"onUpdate:modelValue":s[1]||=e=>q.value=e,options:[{value:`nameAsc`,label:m(v)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:m(v)(`settings.pages.card.name_desc`)},{value:`recent`,label:m(v)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),n(`div`,{class:c([`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))]":m(V).size>0}])},[o(m(_),{modelValue:J.value,"onUpdate:modelValue":s[2]||=e=>J.value=e,accept:`*.json`},{default:re(({isDragging:e})=>[e?(l(),a(`div`,A,[s[9]||=n(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),n(`p`,j,p(m(v)(`settings.pages.card.drop_here`)),1)])):(l(),a(`div`,D,[s[8]||=n(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),n(`p`,O,p(m(v)(`settings.pages.card.upload`)),1),n(`p`,k,p(m(v)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),o(y,{onClick:pe}),m(V).size>0?(l(!0),a(e,{key:0},d(X.value,e=>(l(),r(oe,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===m(H),"is-selected":e.id===U.value&&W.value,version:he(e.id),"consciousness-model":$(e.id,`consciousness`),"voice-model":$(e.id,`voice`),onSelect:t=>fe(e.id),onActivate:t=>me(e.id),onDelete:t=>de(e.id)},null,8,[`id`,`name`,`description`,`is-active`,`is-selected`,`version`,`consciousness-model`,`voice-model`,`onSelect`,`onActivate`,`onDelete`]))),128)):i(``,!0),m(V).size===0?(l(),a(`div`,M,[s[10]||=n(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),n(`p`,null,p(m(v)(`settings.pages.card.no_cards`)),1)])):i(``,!0),K.value&&X.value.length===0?(l(),a(`div`,N,[s[11]||=n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,P,[n(`span`,F,p(m(v)(`settings.pages.card.no_results`)),1),n(`span`,I,p(m(v)(`settings.pages.card.try_different_search`)),1)])])):i(``,!0)],2)]),o(x,{modelValue:Z.value,"onUpdate:modelValue":s[3]||=e=>Z.value=e,"card-name":Q.value?(u=m(R).getCard(Q.value))?.name:``,onConfirm:ue,onCancel:s[4]||=e=>Q.value=null},null,8,[`modelValue`,`card-name`]),o(S,{modelValue:W.value,"onUpdate:modelValue":s[5]||=e=>W.value=e,"card-id":U.value},null,8,[`modelValue`,`card-id`]),o(b,{modelValue:G.value,"onUpdate:modelValue":s[6]||=e=>G.value=e},null,8,[`modelValue`]),g((l(),a(`div`,L,s[12]||=[n(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[f]])],64)}}});typeof v==`function`&&v(R);var z=R;export{z as default}; \ No newline at end of file diff --git a/assets/alibaba-cloud-model-studio-BPpbwzjz.js b/assets/alibaba-cloud-model-studio-DKtpBeWj.js similarity index 85% rename from assets/alibaba-cloud-model-studio-BPpbwzjz.js rename to assets/alibaba-cloud-model-studio-DKtpBeWj.js index 74084cc63d8b7dde4edfa04e50591924ba666f7f..8e3c71c4b18e381aec4846b0707a9c30da5609b6 100644 --- a/assets/alibaba-cloud-model-studio-BPpbwzjz.js +++ b/assets/alibaba-cloud-model-studio-DKtpBeWj.js @@ -1 +1 @@ -import{computed as e,createBaseVNode as t,createBlock as n,createVNode as r,defineComponent as i,onMounted as a,openBlock as o,ref as s,storeToRefs as c,unref as l,useI18n as u,watch as d,withCtx as f}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import{FieldRange_default as h}from"./src-CX9nVT7I.js";import{SpeechPlayground_default as g,SpeechProviderSettings_default as _}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as v}from"./route-block-CC3cgg4Q.js";const y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`;var S=i({__name:`alibaba-cloud-model-studio`,setup(i){let v={speed:1},S=s(0),C=s(1),w=s(0),T=m(),E=p(),{providers:D}=c(E),{t:O}=u(),k=e(()=>{var e;return!!(e=D.value[b])?.apiKey}),A=e(()=>T.availableVoices[b]||[]);async function j(e,t,n){let r=E.getProviderInstance(b);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(b),a=i.model||x;return await T.speech(r,a,e,t,{...i,...v})}return a(async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)}),d(S,async()=>{let e=E.getProviderConfig(b);e.pitch=S.value}),d(C,async()=>{let e=E.getProviderConfig(b);e.speed=C.value}),d(w,async()=>{let e=E.getProviderConfig(b);e.volume=w.value}),d(D,async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,i)=>(o(),n(l(_),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":f(()=>[t(`div`,y,[r(l(h),{modelValue:S.value,"onUpdate:modelValue":i[0]||=e=>S.value=e,label:l(O)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:l(O)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),r(l(h),{modelValue:C.value,"onUpdate:modelValue":i[1]||=e=>C.value=e,label:l(O)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(O)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(h),{modelValue:w.value,"onUpdate:modelValue":i[2]||=e=>w.value=e,label:l(O)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:l(O)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:f(()=>[r(l(g),{"available-voices":A.value,"generate-speech":j,"api-key-configured":k.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof v==`function`&&v(S);var C=S;export{C as default}; \ No newline at end of file +import{computed as e,createBaseVNode as t,createBlock as n,createVNode as r,defineComponent as i,onMounted as a,openBlock as o,ref as s,storeToRefs as c,unref as l,useI18n as u,watch as d,withCtx as f}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import{FieldRange_default as h}from"./src-CmPNYgc5.js";import{SpeechPlayground_default as g,SpeechProviderSettings_default as _}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as v}from"./route-block-CC3cgg4Q.js";const y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`;var S=i({__name:`alibaba-cloud-model-studio`,setup(i){let v={speed:1},S=s(0),C=s(1),w=s(0),T=m(),E=p(),{providers:D}=c(E),{t:O}=u(),k=e(()=>{var e;return!!(e=D.value[b])?.apiKey}),A=e(()=>T.availableVoices[b]||[]);async function j(e,t,n){let r=E.getProviderInstance(b);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(b),a=i.model||x;return await T.speech(r,a,e,t,{...i,...v})}return a(async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)}),d(S,async()=>{let e=E.getProviderConfig(b);e.pitch=S.value}),d(C,async()=>{let e=E.getProviderConfig(b);e.speed=C.value}),d(w,async()=>{let e=E.getProviderConfig(b);e.volume=w.value}),d(D,async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,i)=>(o(),n(l(_),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":f(()=>[t(`div`,y,[r(l(h),{modelValue:S.value,"onUpdate:modelValue":i[0]||=e=>S.value=e,label:l(O)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:l(O)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),r(l(h),{modelValue:C.value,"onUpdate:modelValue":i[1]||=e=>C.value=e,label:l(O)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(O)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(h),{modelValue:w.value,"onUpdate:modelValue":i[2]||=e=>w.value=e,label:l(O)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:l(O)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:f(()=>[r(l(g),{"available-voices":A.value,"generate-speech":j,"api-key-configured":k.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof v==`function`&&v(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/anthropic-D6Mj8Jul.js b/assets/anthropic-DCrOC5Oo.js similarity index 86% rename from assets/anthropic-D6Mj8Jul.js rename to assets/anthropic-DCrOC5Oo.js index 2dcc4fea692403314f23e73ca4b439d3c08881af..c5fa59fe9d10fb20e5ae634cd2e57f382b0d4dab 100644 --- a/assets/anthropic-D6Mj8Jul.js +++ b/assets/anthropic-DCrOC5Oo.js @@ -1 +1 @@ -import{computed as e,createBaseVNode as t,createBlock as n,createTextVNode as r,createVNode as i,defineComponent as a,onMounted as o,openBlock as s,storeToRefs as c,unref as l,useI18n as u,useRouter as d,watch as f,withCtx as p}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as m}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as h,ProviderApiKeyInput_default as g,ProviderBaseUrlInput_default as _,ProviderBasicSettings_default as v,ProviderSettingsContainer_default as y,ProviderSettingsLayout_default as b}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as x}from"./route-block-CC3cgg4Q.js";const S=`anthropic`;var C=a({__name:`anthropic`,setup(a){let{t:x}=u(),C=d(),w=m(),{providers:T}=c(w),E=e(()=>w.getProviderMetadata(S)),D=e({get:()=>{var e;return(e=T.value[S])?.apiKey||``},set:e=>{T.value[S]||(T.value[S]={}),T.value[S].apiKey=e}}),O=e({get:()=>{var e;return(e=T.value[S])?.baseUrl||`https://api.anthropic.com/v1/`},set:e=>{T.value[S]||(T.value[S]={}),T.value[S].baseUrl=e}});o(()=>{var e,t;T.value[S]||(T.value[S]={baseUrl:`https://api.anthropic.com/v1/`}),D.value=(e=T.value[S])?.apiKey||``,O.value=(t=T.value[S])?.baseUrl||`https://api.anthropic.com/v1/`}),f([D,O],()=>{T.value[S]={...T.value[S],apiKey:D.value,baseUrl:O.value||`https://api.anthropic.com/v1/`}});function k(){T.value[S]={baseUrl:`https://api.anthropic.com/v1/`}}return(e,a)=>{var o,c;return s(),n(l(b),{"provider-name":(o=E.value)?.localizedName||`Anthropic | Claude`,"provider-icon":(c=E.value)?.icon,"on-back":()=>l(C).back()},{default:p(()=>[a[2]||=t(`div`,{bg:`orange-50 dark:orange-900/20`,"rounded-xl":``,"p-4":``,flex:`~ col gap-3`},[t(`h2`,{"text-xl":``,"font-semibold":``,text:`orange-700 dark:orange-500`},` Before you start `),t(`p`,null,[r(` While Anthropic recently did announce that they are having a beta support for OpenAI SDK compatibility `),t(`a`,{underline:``,href:`https://docs.anthropic.com/en/api/openai-sdk`},`(you can read more here)`),r(`, but due to the implementation details comes with `),t(`a`,{underline:``,href:`https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS`},`CORS`),r(` restrictions which not aligned with the OpenAI SDK, it's currently not possible to use this provider in the browser. `)]),t(`p`,null,[r(` If you do need to use this provider, you will need a dedicated proxy backend like a Serverless Function running on `),t(`a`,{underline:``,href:`https://workers.cloudflare.com/`},`Cloudflare Workers`),r(` or some CORS bypassing services to bypass the CORS restrictions. `)])],-1),i(l(y),null,{default:p(()=>[i(l(v),{title:l(x)(`settings.pages.providers.common.section.basic.title`),description:l(x)(`settings.pages.providers.common.section.basic.description`),"on-reset":k},{default:p(()=>{var e;return[i(l(g),{modelValue:D.value,"onUpdate:modelValue":a[0]||=e=>D.value=e,"provider-name":(e=E.value)?.localizedName||`Anthropic`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),i(l(h),{title:l(x)(`settings.pages.providers.common.section.advanced.title`)},{default:p(()=>[i(l(_),{modelValue:O.value,"onUpdate:modelValue":a[1]||=e=>O.value=e,placeholder:`https://api.anthropic.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1,__:[2]},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof x==`function`&&x(C);var w=C;export{w as default}; \ No newline at end of file +import{computed as e,createBaseVNode as t,createBlock as n,createTextVNode as r,createVNode as i,defineComponent as a,onMounted as o,openBlock as s,storeToRefs as c,unref as l,useI18n as u,useRouter as d,watch as f,withCtx as p}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as m}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as h,ProviderApiKeyInput_default as g,ProviderBaseUrlInput_default as _,ProviderBasicSettings_default as v,ProviderSettingsContainer_default as y,ProviderSettingsLayout_default as b}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as x}from"./route-block-CC3cgg4Q.js";const S=`anthropic`;var C=a({__name:`anthropic`,setup(a){let{t:x}=u(),C=d(),w=m(),{providers:T}=c(w),E=e(()=>w.getProviderMetadata(S)),D=e({get:()=>{var e;return(e=T.value[S])?.apiKey||``},set:e=>{T.value[S]||(T.value[S]={}),T.value[S].apiKey=e}}),O=e({get:()=>{var e;return(e=T.value[S])?.baseUrl||`https://api.anthropic.com/v1/`},set:e=>{T.value[S]||(T.value[S]={}),T.value[S].baseUrl=e}});o(()=>{var e,t;T.value[S]||(T.value[S]={baseUrl:`https://api.anthropic.com/v1/`}),D.value=(e=T.value[S])?.apiKey||``,O.value=(t=T.value[S])?.baseUrl||`https://api.anthropic.com/v1/`}),f([D,O],()=>{T.value[S]={...T.value[S],apiKey:D.value,baseUrl:O.value||`https://api.anthropic.com/v1/`}});function k(){T.value[S]={baseUrl:`https://api.anthropic.com/v1/`}}return(e,a)=>{var o,c;return s(),n(l(b),{"provider-name":(o=E.value)?.localizedName||`Anthropic | Claude`,"provider-icon":(c=E.value)?.icon,"on-back":()=>l(C).back()},{default:p(()=>[a[2]||=t(`div`,{bg:`orange-50 dark:orange-900/20`,"rounded-xl":``,"p-4":``,flex:`~ col gap-3`},[t(`h2`,{"text-xl":``,"font-semibold":``,text:`orange-700 dark:orange-500`},` Before you start `),t(`p`,null,[r(` While Anthropic recently did announce that they are having a beta support for OpenAI SDK compatibility `),t(`a`,{underline:``,href:`https://docs.anthropic.com/en/api/openai-sdk`},`(you can read more here)`),r(`, but due to the implementation details comes with `),t(`a`,{underline:``,href:`https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS`},`CORS`),r(` restrictions which not aligned with the OpenAI SDK, it's currently not possible to use this provider in the browser. `)]),t(`p`,null,[r(` If you do need to use this provider, you will need a dedicated proxy backend like a Serverless Function running on `),t(`a`,{underline:``,href:`https://workers.cloudflare.com/`},`Cloudflare Workers`),r(` or some CORS bypassing services to bypass the CORS restrictions. `)])],-1),i(l(y),null,{default:p(()=>[i(l(v),{title:l(x)(`settings.pages.providers.common.section.basic.title`),description:l(x)(`settings.pages.providers.common.section.basic.description`),"on-reset":k},{default:p(()=>{var e;return[i(l(g),{modelValue:D.value,"onUpdate:modelValue":a[0]||=e=>D.value=e,"provider-name":(e=E.value)?.localizedName||`Anthropic`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),i(l(h),{title:l(x)(`settings.pages.providers.common.section.advanced.title`)},{default:p(()=>[i(l(_),{modelValue:O.value,"onUpdate:modelValue":a[1]||=e=>O.value=e,placeholder:`https://api.anthropic.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1,__:[2]},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof x==`function`&&x(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/appearance-B6qqUE9Q.js b/assets/appearance-t6hovndX.js similarity index 81% rename from assets/appearance-B6qqUE9Q.js rename to assets/appearance-t6hovndX.js index 92bf4f0fe472ad10630a0e6b767d7c29cb54b892..cc6879b1bf30d086ee2614bc5853136590db62bd 100644 --- a/assets/appearance-B6qqUE9Q.js +++ b/assets/appearance-t6hovndX.js @@ -1 +1 @@ -import{Fragment as e,computed as t,createBaseVNode as n,createBlock as r,createElementBlock as i,defineComponent as a,normalizeStyle as o,openBlock as s,renderList as c,resolveDirective as l,unref as u,useI18n as d,withDirectives as f}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{IconItem_default as p}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as m}from"./route-block-CC3cgg4Q.js";const h={flex:`~ col gap-4`,"font-thin":``},g={flex:`~ col gap-4`},_={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},v={text:`60`,"i-solar:settings-bold-duotone":``};var y=a({__name:`index`,setup(a){let{t:m}=d(),y=t(()=>[{title:m(`settings.pages.themes.general.title`),description:m(`settings.pages.themes.general.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/appearance/general`},{title:m(`settings.pages.themes.color-scheme.title`),description:m(`settings.pages.themes.color-scheme.description`),icon:`i-solar:pallete-2-bold-duotone`,to:`/settings/appearance/color-scheme`},{title:m(`settings.pages.themes.developer.title`),description:m(`settings.pages.themes.developer.description`),icon:`i-solar:code-bold-duotone`,to:`/settings/appearance/developer`}]);return(t,a)=>{let d=l(`motion`);return s(),i(`div`,h,[a[0]||=n(`div`,null,null,-1),n(`div`,g,[(s(!0),i(e,null,c(y.value,(e,t)=>f((s(),r(u(p),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:o({transitionDelay:`${t*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[d]])),128))]),f((s(),i(`div`,_,[f(n(`div`,v,null,512),[[d]])])),[[d]])])}}});typeof m==`function`&&m(y);var b=y;export{b as default}; \ No newline at end of file +import{Fragment as e,computed as t,createBaseVNode as n,createBlock as r,createElementBlock as i,defineComponent as a,normalizeStyle as o,openBlock as s,renderList as c,resolveDirective as l,unref as u,useI18n as d,withDirectives as f}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{IconItem_default as p}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as m}from"./route-block-CC3cgg4Q.js";const h={flex:`~ col gap-4`,"font-thin":``},g={flex:`~ col gap-4`},_={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},v={text:`60`,"i-solar:settings-bold-duotone":``};var y=a({__name:`index`,setup(a){let{t:m}=d(),y=t(()=>[{title:m(`settings.pages.themes.general.title`),description:m(`settings.pages.themes.general.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/appearance/general`},{title:m(`settings.pages.themes.color-scheme.title`),description:m(`settings.pages.themes.color-scheme.description`),icon:`i-solar:pallete-2-bold-duotone`,to:`/settings/appearance/color-scheme`},{title:m(`settings.pages.themes.developer.title`),description:m(`settings.pages.themes.developer.description`),icon:`i-solar:code-bold-duotone`,to:`/settings/appearance/developer`}]);return(t,a)=>{let d=l(`motion`);return s(),i(`div`,h,[a[0]||=n(`div`,null,null,-1),n(`div`,g,[(s(!0),i(e,null,c(y.value,(e,t)=>f((s(),r(u(p),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:o({transitionDelay:`${t*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[d]])),128))]),f((s(),i(`div`,_,[f(n(`div`,v,null,512),[[d]])])),[[d]])])}}});typeof m==`function`&&m(y);var b=y;export{b as default}; \ No newline at end of file diff --git a/assets/audio-DlHM02zp.js b/assets/audio-C1MdKXG0.js similarity index 89% rename from assets/audio-DlHM02zp.js rename to assets/audio-C1MdKXG0.js index 6d45740fa4ac41ea53b16dba2ed1db7e86644164..492b7d24fba6a9484caead6d501817529a863bfa 100644 --- a/assets/audio-DlHM02zp.js +++ b/assets/audio-C1MdKXG0.js @@ -1 +1 @@ -import{createBaseVNode as e,createElementBlock as t,defineComponent as n,openBlock as r,ref as i}from"./index-BSwg6FIo.js";var a=n({__name:`audio`,setup(n){let a=i(),o=i();function s(e){var t,n;if(!e)return;let r=(t=o.value)==null||(t=t.files)==null?void 0:t[0];if(!r)return;let i=document.createElement(`audio`);(n=a.value)?.appendChild(i),i.src=URL.createObjectURL(r),i.controls=!0,i.load(),i.play()}return(n,i)=>(r(),t(`div`,null,[e(`div`,null,[e(`div`,{ref_key:`containerRef`,ref:a},null,512),e(`input`,{ref_key:`fileInputRef`,ref:o,type:`file`,onChange:s},null,544)])]))}}),o=a;export{o as default}; \ No newline at end of file +import{createBaseVNode as e,createElementBlock as t,defineComponent as n,openBlock as r,ref as i}from"./index-DKziOBM4.js";var a=n({__name:`audio`,setup(n){let a=i(),o=i();function s(e){var t,n;if(!e)return;let r=(t=o.value)==null||(t=t.files)==null?void 0:t[0];if(!r)return;let i=document.createElement(`audio`);(n=a.value)?.appendChild(i),i.src=URL.createObjectURL(r),i.controls=!0,i.load(),i.play()}return(n,i)=>(r(),t(`div`,null,[e(`div`,null,[e(`div`,{ref_key:`containerRef`,ref:a},null,512),e(`input`,{ref_key:`fileInputRef`,ref:o,type:`file`,onChange:s},null,544)])]))}}),o=a;export{o as default}; \ No newline at end of file diff --git a/assets/background-remove-BBVN5gMF.js b/assets/background-remove-DWgFP94H.js similarity index 99% rename from assets/background-remove-BBVN5gMF.js rename to assets/background-remove-DWgFP94H.js index a479adecb0cad374bfcf3169e232a2009b7db9a5..073a04dbd07cb7842ec9506f9967f73dd177e329 100644 --- a/assets/background-remove-BBVN5gMF.js +++ b/assets/background-remove-DWgFP94H.js @@ -1,4 +1,4 @@ -var e=function(exports){function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}return exports.defineProperty=i,exports}({});import{Fragment as t,__export as n,__require as r,computed as i,createBaseVNode as a,createCommentVNode as o,createElementBlock as s,createVNode as c,defineComponent as l,normalizeStyle as u,onMounted as d,openBlock as f,ref as p,renderList as m,toDisplayString as h,unref as g}from"./index-BSwg6FIo.js";import"./src-CX9nVT7I.js";import{InputFile_default as _}from"./InputFile-R2knYJRe.js";import{check as v}from"./webgpu-aYTuek9b.js";const y=new Map,b=[],x=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=y.get(e);if(r===void 0)y.set(e,{backend:t,priority:n});else if(r.priority>n)return;else if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`);if(n>=0){let t=b.indexOf(e);t!==-1&&b.splice(t,1);for(let t=0;t{let t=y.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},C=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?b:n,i,a=[],o=new Set;for(let e of r){let t=await S(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]},w=`1.22.0`;let T=`warning`;const E={wasm:{},webgl:{},webgpu:{},versions:{common:w},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);T=e}},get logLevel(){return T}};Object.defineProperty(E,`logLevel`,{enumerable:!0});const D=E,O=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t===void 0||t.format===void 0?`RGB`:t.format,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=4,p=0,m=1,h=2,g=3,_=0,v=d,y=d*2,b=-1;s===`RGBA`?(_=0,v=d,y=d*2,b=d*3):s===`RGB`?(_=0,v=d,y=d*2):s===`RBG`&&(_=0,y=d,v=d*2),r=n.createImageData(i,a);for(let t=0;t{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat===void 0||t.tensorFormat===void 0?`RGB`:t.tensorFormat,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,k(o,s)}else throw Error(`Can not access image data`)}else if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(k(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return k(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},ne=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new j({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},re=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new j({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},ie=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new j({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},A=(e,t,n)=>new j({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),ae=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),oe=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]);let se=!1;const ce=()=>{if(!se){se=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(ae.set(`int64`,BigInt64Array),oe.set(BigInt64Array,`int64`)),t&&(ae.set(`uint64`,BigUint64Array),oe.set(BigUint64Array,`uint64`)),r?(ae.set(`float16`,n),oe.set(n,`float16`)):ae.set(`float16`,Uint16Array)}},le=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new j(e.type,e.data,t);case`cpu-pinned`:return new j({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new j({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new j({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new j({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var j=class{constructor(e,t,n){ce();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=ae.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=ae.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=oe.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=le(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return te(e,t)}static fromTexture(e,t){return ne(e,t)}static fromGpuBuffer(e,t){return re(e,t)}static fromMLTensor(e,t){return ie(e,t)}static fromPinnedBuffer(e,t,n){return A(e,t,n)}toDataURL(e){return O(this,e)}toImageData(e){return ee(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return ue(this,e)}};const M=j,de=(e,t)=>{(E.trace===void 0?!E.wasm.trace:!E.trace)||console.timeStamp(`${e}::ORT::${t}`)},fe=(e,t)=>{var n;let r=(n=Error().stack)?.split(/\r\n|\r|\n/g)||[],i=!1;for(let n=0;n{(E.trace===void 0?!E.wasm.trace:!E.trace)||fe(`BEGIN`,e)},N=e=>{(E.trace===void 0?!E.wasm.trace:!E.trace)||fe(`END`,e)};var P=class e{constructor(e){this.handler=e}async run(e,t,n){pe();let r={},i={};if(typeof e!=`object`||!e||e instanceof M||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof M)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof M)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else i=t}}else if(t!==void 0)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(e[t]===void 0)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof M?s[e]=t:s[e]=new M(t.type,t.data,t.dims)}return N(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){pe();let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(i!==void 0)throw TypeError(`'options' must be an object.`)}else if(r!==void 0)throw TypeError(`'byteLength' must be a number.`)}else if(n!==void 0)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await C(o),l=await s.createInferenceSessionHandler(a,c);return N(),new e(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const F=P;var I={};n(I,{InferenceSession:()=>F,TRACE:()=>de,TRACE_FUNC_BEGIN:()=>pe,TRACE_FUNC_END:()=>N,Tensor:()=>M,env:()=>D,registerBackend:()=>x});var me={};n(me,{InferenceSession:()=>ut,TRACE:()=>rt,TRACE_FUNC_BEGIN:()=>at,TRACE_FUNC_END:()=>ot,Tensor:()=>tt,default:()=>Sf,env:()=>R,registerBackend:()=>Te}); +var e=function(exports){function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}return exports.defineProperty=i,exports}({});import{Fragment as t,__export as n,__require as r,computed as i,createBaseVNode as a,createCommentVNode as o,createElementBlock as s,createVNode as c,defineComponent as l,normalizeStyle as u,onMounted as d,openBlock as f,ref as p,renderList as m,toDisplayString as h,unref as g}from"./index-DKziOBM4.js";import"./src-CmPNYgc5.js";import{InputFile_default as _}from"./InputFile-DEuushJG.js";import{check as v}from"./webgpu-aYTuek9b.js";const y=new Map,b=[],x=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=y.get(e);if(r===void 0)y.set(e,{backend:t,priority:n});else if(r.priority>n)return;else if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`);if(n>=0){let t=b.indexOf(e);t!==-1&&b.splice(t,1);for(let t=0;t{let t=y.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},C=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?b:n,i,a=[],o=new Set;for(let e of r){let t=await S(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]},w=`1.22.0`;let T=`warning`;const E={wasm:{},webgl:{},webgpu:{},versions:{common:w},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);T=e}},get logLevel(){return T}};Object.defineProperty(E,`logLevel`,{enumerable:!0});const D=E,O=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t===void 0||t.format===void 0?`RGB`:t.format,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=4,p=0,m=1,h=2,g=3,_=0,v=d,y=d*2,b=-1;s===`RGBA`?(_=0,v=d,y=d*2,b=d*3):s===`RGB`?(_=0,v=d,y=d*2):s===`RBG`&&(_=0,y=d,v=d*2),r=n.createImageData(i,a);for(let t=0;t{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat===void 0||t.tensorFormat===void 0?`RGB`:t.tensorFormat,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,k(o,s)}else throw Error(`Can not access image data`)}else if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(k(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return k(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},ne=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new j({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},re=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new j({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},ie=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new j({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},A=(e,t,n)=>new j({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),ae=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),oe=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]);let se=!1;const ce=()=>{if(!se){se=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(ae.set(`int64`,BigInt64Array),oe.set(BigInt64Array,`int64`)),t&&(ae.set(`uint64`,BigUint64Array),oe.set(BigUint64Array,`uint64`)),r?(ae.set(`float16`,n),oe.set(n,`float16`)):ae.set(`float16`,Uint16Array)}},le=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new j(e.type,e.data,t);case`cpu-pinned`:return new j({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new j({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new j({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new j({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var j=class{constructor(e,t,n){ce();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=ae.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=ae.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=oe.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=le(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return te(e,t)}static fromTexture(e,t){return ne(e,t)}static fromGpuBuffer(e,t){return re(e,t)}static fromMLTensor(e,t){return ie(e,t)}static fromPinnedBuffer(e,t,n){return A(e,t,n)}toDataURL(e){return O(this,e)}toImageData(e){return ee(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return ue(this,e)}};const M=j,de=(e,t)=>{(E.trace===void 0?!E.wasm.trace:!E.trace)||console.timeStamp(`${e}::ORT::${t}`)},fe=(e,t)=>{var n;let r=(n=Error().stack)?.split(/\r\n|\r|\n/g)||[],i=!1;for(let n=0;n{(E.trace===void 0?!E.wasm.trace:!E.trace)||fe(`BEGIN`,e)},N=e=>{(E.trace===void 0?!E.wasm.trace:!E.trace)||fe(`END`,e)};var P=class e{constructor(e){this.handler=e}async run(e,t,n){pe();let r={},i={};if(typeof e!=`object`||!e||e instanceof M||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof M)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof M)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else i=t}}else if(t!==void 0)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(e[t]===void 0)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof M?s[e]=t:s[e]=new M(t.type,t.data,t.dims)}return N(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){pe();let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(i!==void 0)throw TypeError(`'options' must be an object.`)}else if(r!==void 0)throw TypeError(`'byteLength' must be a number.`)}else if(n!==void 0)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await C(o),l=await s.createInferenceSessionHandler(a,c);return N(),new e(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const F=P;var I={};n(I,{InferenceSession:()=>F,TRACE:()=>de,TRACE_FUNC_BEGIN:()=>pe,TRACE_FUNC_END:()=>N,Tensor:()=>M,env:()=>D,registerBackend:()=>x});var me={};n(me,{InferenceSession:()=>ut,TRACE:()=>rt,TRACE_FUNC_BEGIN:()=>at,TRACE_FUNC_END:()=>ot,Tensor:()=>tt,default:()=>Sf,env:()=>R,registerBackend:()=>Te}); /*! * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 * Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/assets/chat-6NJMDnl7.js b/assets/chat-B0HcMONu.js similarity index 99% rename from assets/chat-6NJMDnl7.js rename to assets/chat-B0HcMONu.js index 1cb4a0bd24be7f52f31f02e318126e16acac6750..4d515a3306bf4efac395cf95cfdfbf7e0c77b26e 100644 --- a/assets/chat-6NJMDnl7.js +++ b/assets/chat-B0HcMONu.js @@ -1,3 +1,3 @@ -var e=function(exports){function t(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function n(e,n,r){return e.set(t(e,n),r),r}function r(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function i(e,t,n){r(e,t),t.set(e,n)}function a(e,n){return e.get(t(e,n))}return exports.classPrivateFieldGet2=a,exports.classPrivateFieldInitSpec=i,exports.classPrivateFieldSet2=n,exports}({});import{Fragment as t,createBaseVNode as n,createCommentVNode as r,createElementBlock as i,defineComponent as a,isRef as o,openBlock as s,ref as c,renderList as l,toDisplayString as u,toRaw as d,unref as f,useLocalStorage as p,vModelText as m,withDirectives as h}from"./index-BSwg6FIo.js";import{streamText as g}from"./dist-D1uPCnfx.js";var _,v,y;let b;const x=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(t,n){e=t;try{return n()}finally{e=null}}}},S=new WeakMap,C=new WeakMap;let w=0,T=0;const E=e=>{let t=`${w++}`,n={debugLabel:e?.debugLabel??t,include:e=>r.has(e),with:i=>{let a=`${T++}`,o={[Symbol.toStringTag]:e?.debugLabel??`WorkflowEvent(${t}.${a})`,toString:()=>e?.debugLabel?e.debugLabel:`WorkflowEvent(${t}.${a})`,toJSON:()=>({type:e?.debugLabel?e.debugLabel:t,data:i}),get data(){return i}};return r.add(o),C.set(o,n),o}},r=new WeakSet;S.set(n,r),Object.defineProperty(n,Symbol.toStringTag,{get:()=>n?.debugLabel??`WorkflowEvent<${t}>`}),Object.defineProperty(n,`displayName`,{value:n?.debugLabel??`WorkflowEvent<${t}>`});let i=e?.uniqueId;return Object.defineProperty(n,`uniqueId`,{get:()=>(i||=t,i),set:()=>{throw Error(`uniqueId is readonly`)}}),n.toString=()=>e?.debugLabel??`WorkflowEvent<${t}>`,n},D=e=>typeof e==`object`&&e?S.has(e):!1,O=e=>typeof e==`object`&&e?C.get(e):void 0,k=e=>typeof e==`object`&&!!e&&`data`in e,A=e=>e!=null&&typeof e.then==`function`;function j(e,t){let n=Array(e.length);for(let r of t)for(let t=0;t(e.add(t),()=>{e.delete(t)}),publish:(...t)=>{let n=[];for(let r of e)n.push(r(...t));return n}};return M.set(t,e),t}var F=class extends TransformStream{constructor(){super({transform:(e,t)=>{O(e)&&t.enqueue(JSON.stringify({data:e.data,uniqueId:O(e).uniqueId})+` +var e=function(exports){function t(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function n(e,n,r){return e.set(t(e,n),r),r}function r(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function i(e,t,n){r(e,t),t.set(e,n)}function a(e,n){return e.get(t(e,n))}return exports.classPrivateFieldGet2=a,exports.classPrivateFieldInitSpec=i,exports.classPrivateFieldSet2=n,exports}({});import{Fragment as t,createBaseVNode as n,createCommentVNode as r,createElementBlock as i,defineComponent as a,isRef as o,openBlock as s,ref as c,renderList as l,toDisplayString as u,toRaw as d,unref as f,useLocalStorage as p,vModelText as m,withDirectives as h}from"./index-DKziOBM4.js";import{streamText as g}from"./dist-D1uPCnfx.js";var _,v,y;let b;const x=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(t,n){e=t;try{return n()}finally{e=null}}}},S=new WeakMap,C=new WeakMap;let w=0,T=0;const E=e=>{let t=`${w++}`,n={debugLabel:e?.debugLabel??t,include:e=>r.has(e),with:i=>{let a=`${T++}`,o={[Symbol.toStringTag]:e?.debugLabel??`WorkflowEvent(${t}.${a})`,toString:()=>e?.debugLabel?e.debugLabel:`WorkflowEvent(${t}.${a})`,toJSON:()=>({type:e?.debugLabel?e.debugLabel:t,data:i}),get data(){return i}};return r.add(o),C.set(o,n),o}},r=new WeakSet;S.set(n,r),Object.defineProperty(n,Symbol.toStringTag,{get:()=>n?.debugLabel??`WorkflowEvent<${t}>`}),Object.defineProperty(n,`displayName`,{value:n?.debugLabel??`WorkflowEvent<${t}>`});let i=e?.uniqueId;return Object.defineProperty(n,`uniqueId`,{get:()=>(i||=t,i),set:()=>{throw Error(`uniqueId is readonly`)}}),n.toString=()=>e?.debugLabel??`WorkflowEvent<${t}>`,n},D=e=>typeof e==`object`&&e?S.has(e):!1,O=e=>typeof e==`object`&&e?C.get(e):void 0,k=e=>typeof e==`object`&&!!e&&`data`in e,A=e=>e!=null&&typeof e.then==`function`;function j(e,t){let n=Array(e.length);for(let r of t)for(let t=0;t(e.add(t),()=>{e.delete(t)}),publish:(...t)=>{let n=[];for(let r of e)n.push(r(...t));return n}};return M.set(t,e),t}var F=class extends TransformStream{constructor(){super({transform:(e,t)=>{O(e)&&t.enqueue(JSON.stringify({data:e.data,uniqueId:O(e).uniqueId})+` `)}})}},I=(_=new WeakMap,class extends TransformStream{constructor(t){super({transform:(t,n)=>{let r=t.split(` `).map(e=>e.trim()).filter(e=>e.length>0);r.forEach(t=>{let r=JSON.parse(t),i=Object.values(e.classPrivateFieldGet2(_,this)).find(e=>e.uniqueId===r.uniqueId);if(i){let e=i.with(r.data);n.enqueue(e)}else console.warn(`Unknown event: ${r.uniqueId}`)})}}),e.classPrivateFieldInitSpec(this,_,void 0),e.classPrivateFieldSet2(_,this,t)}}),L=(v=new WeakMap,y=new WeakMap,b=Symbol.asyncIterator,class t extends ReadableStream{on(t,n){return e.classPrivateFieldGet2(y,this).subscribe(e=>{t.include(e)&&n(e)})}constructor(t,n){if(!t&&!n)throw TypeError(`Either subscribable or root stream must be provided`);if(super(),e.classPrivateFieldInitSpec(this,v,void 0),e.classPrivateFieldInitSpec(this,y,void 0),t){e.classPrivateFieldSet2(y,this,t);let r;e.classPrivateFieldSet2(v,this,n??new ReadableStream({start:e=>{r=t.subscribe(t=>{e.enqueue(t)})},cancel:()=>{r()}}))}else{e.classPrivateFieldSet2(y,this,P()),e.classPrivateFieldSet2(v,this,n.pipeThrough(new TransformStream({transform:(t,n)=>{e.classPrivateFieldGet2(y,this).publish(t),n.enqueue(t)}})));return}}static fromReadableStream(e){return new t(null,e.pipeThrough(new TransformStream({transform:(e,t)=>{t.enqueue(e)}})))}static fromResponse(e,n){let r=e.body;if(!r)throw Error(`Response body is not readable`);return new t(null,r.pipeThrough(new TextDecoderStream).pipeThrough(new I(n)))}toResponse(t,n=new F){return new Response(e.classPrivateFieldGet2(v,this).pipeThrough(n).pipeThrough(new TextEncoderStream),t)}get locked(){return e.classPrivateFieldGet2(v,this).locked}[b](){return e.classPrivateFieldGet2(v,this)[Symbol.asyncIterator]()}cancel(t){return e.classPrivateFieldGet2(v,this).cancel(t)}getReader(){return e.classPrivateFieldGet2(v,this).getReader()}pipeThrough(n,r){let i=e.classPrivateFieldGet2(v,this).pipeThrough(n,r);return new t(null,i)}pipeTo(t,n){return e.classPrivateFieldGet2(v,this).pipeTo(t,n)}tee(){let[n,r]=e.classPrivateFieldGet2(v,this).tee();return[new t(e.classPrivateFieldGet2(y,this),n),new t(e.classPrivateFieldGet2(y,this),r)]}forEach(t){return e.classPrivateFieldGet2(v,this).pipeTo(new WritableStream({write:e=>{t(e)}}))}map(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(e(t))}}))}values(t){return e.classPrivateFieldGet2(v,this).values(t)}take(e){let t=0;return this.pipeThrough(new TransformStream({transform:(n,r)=>{t=e&&r.terminate()}}))}filter(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{(typeof e==`function`?e(t):D(e)?e.include(t):e===t)&&n.enqueue(t)}}))}until(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(t),(typeof e==`function`?e(t):D(e)?e.include(t):e===t)&&n.terminate()}}))}async toArray(){let e=[];return await this.pipeTo(new WritableStream({write:t=>{e.push(t)}})),e}});const R=x();function z(){let e=R.getStore();if(!e)throw Error(`No current context found`);return e}const B=x(),V=new WeakMap,H=({listeners:e})=>{let t=[],n=(e,t,n,r)=>{let c,l={get abortController(){return c||=new AbortController,c},async:`constructor`in e?e.constructor.name===`AsyncFunction`:!1,pending:null,handler:e,inputEvents:t,inputs:n,outputs:[],prev:r,next:new Set,get root(){return o}};l.prev.next.add(l);let u=i(l);B.run(l,()=>{let e=[...new Set([...N(s.__internal__call_context),...N(u.__internal__call_context)])];R.run(u,()=>{let t=0,n=r=>{if(t===e.length){let e;try{e=r.handler(...r.inputs)}catch(e){if(c??a)(c??a).abort(e);else throw console.error(`unhandled error in handler`,e),e}A(e)?(l.async=!0,l.pending=e.then(e=>(k(e)&&u.sendEvent(e),e))):k(e)&&u.sendEvent(e)}let i=e[t];i&&(t++,i(r,n))};n(l)})})},r=r=>{let i=[...t];[...e].filter(([e])=>{let t=j(e,i);return t.length===e.length}).map(([e,a])=>{let o=j(e,i);o.forEach(e=>{t.splice(t.indexOf(e),1)});for(let t of a)n(t,e,o,r)})},i=e=>{let n=null;return{get stream(){if(!n){let t=P();s.__internal__call_send_event.subscribe(n=>{let r=V.get(n);for(;r;){if(r===e){t.publish(n);break}r=r.prev}}),n=new L(t,null)}return n},get signal(){return e.abortController.signal},sendEvent:(...n)=>{n.forEach(n=>{V.set(n,e),e.outputs.push(n),t.push(n),s.__internal__call_send_event.publish(n,e),r(e)})},__internal__call_context:P(),__internal__call_send_event:P()}},a=new AbortController,o={get abortController(){return a||=new AbortController,a},async:!1,pending:null,inputEvents:[],inputs:[],outputs:[],handler:null,prev:null,next:new Set,get root(){return o}},s=i(o);return s},U=()=>{let e={steps:new Map};return{handle:(t,n)=>{if(e.steps.has(t)){let r=e.steps.get(t);r.add(n)}else{let r=new Set;r.add(n),e.steps.set(t,r)}},createContext(){return H({listeners:e.steps})}}};function W(e,t){let n=(...e)=>{let n=t.filter(([t])=>t.every((t,n)=>t.include(e[n]))).map(([e,t])=>t),r=z(),i=r.sendEvent;return(...e)=>{for(let t=0;tt.include(e[n])))return i(...e)}return console.warn(`Invalid input detected [%s]`,e.map(e=>e.data).join(`, `)),i(...e)}};return{...e,strictHandle:(t,n)=>{let r=(...e)=>{let t=z();return n(t.safeSendEvent,...e)};return e.handle(t,r)},createContext(){let t=e.createContext();return t.__internal__call_context.subscribe((e,t)=>{z().safeSendEvent=n(...e.inputs),t(e)}),t}}}async function G(e,t,n){let{stream:r,sendEvent:i}=e.createContext();i(t);let a=(await r.until(n).toArray()).at(-1);if(!a)throw Error(`No output event received`);return a}const K={flex:``,"flex-col":``,"gap-2":``},q={flex:`~ col`,"gap-2":``},J={flex:``,"flex-col":``,"gap-2":``},Y={grid:``,"grid-cols-2":``,"gap-2":``},X={flex:``,"items-center":``,"gap-2":``},Z={flex:``,"items-center":``,"gap-2":``},Q={flex:``,"items-center":``,"gap-2":``},$={key:0},ee={key:1};var te=a({__name:`chat`,setup(e){let a=p(`settings/llm/baseUrl`,`https://openrouter.ai/api/v1/`),_=p(`settings/llm/apiKey`,``),v=p(`settings/llm/model`,`openai/gpt-4o-mini`),y=c(``),b=c([]),x=c({role:`assistant`,content:``}),S=c(!1),C=E(),w=E(),T=E(),D=E(),O=E();async function k(){S.value=!0;try{let e=W(U(),[[[C],[w,O]],[[w],[T]],[[T],[D]]]);e.handle([C],async()=>{let{sendEvent:t}=e.createContext();x.value={role:`assistant`,content:``},b.value.push({role:`user`,content:y.value}),b.value.push(x.value);let n=await g({baseURL:a.value,apiKey:_.value,model:v.value,messages:b.value.slice(0,b.value.length-1).map(e=>d(e))});for await(let e of n.chunkStream)t(w.with(e.choices[0].delta.content||``));return O.with()}),e.handle([w],async e=>{x.value.content?x.value.content+=e.data:x.value.content=e.data}),await G(e,C.with(),O)}catch(e){console.error(e)}finally{S.value=!1}}return(e,c)=>(s(),i(`div`,K,[n(`div`,q,[n(`div`,J,[c[7]||=n(`div`,null,[n(`span`,{"text-neutral-500":``,"dark:text-neutral-400":``},`LLM`)],-1),n(`div`,Y,[n(`label`,X,[c[4]||=n(`span`,{"text-nowrap":``},` Base URL `,-1),h(n(`input`,{"onUpdate:modelValue":c[0]||=e=>o(a)?a.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[m,f(a)]])]),n(`label`,Z,[c[5]||=n(`span`,{"text-nowrap":``},` API Key `,-1),h(n(`input`,{"onUpdate:modelValue":c[1]||=e=>o(_)?_.value=e:null,type:`password`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[m,f(_)]])]),n(`label`,Q,[c[6]||=n(`span`,{"text-nowrap":``},` Model `,-1),h(n(`input`,{"onUpdate:modelValue":c[2]||=e=>o(v)?v.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[m,f(v)]])])])]),n(`div`,null,[h(n(`textarea`,{"onUpdate:modelValue":c[3]||=e=>y.value=e,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[m,y.value]])]),n(`button`,{"rounded-lg":``,bg:`blue-100 dark:blue-900`,"px-4":``,"py-2":``,onClick:k},` Send `),n(`div`,null,[(s(!0),i(t,null,l(b.value,(e,t)=>(s(),i(`div`,{key:t},[e.role===`user`?(s(),i(`div`,$,[n(`span`,null,u(e.content),1)])):r(``,!0),e.role===`assistant`?(s(),i(`div`,ee,[n(`span`,null,u(e.content),1)])):r(``,!0)]))),128))])])]))}}),ne=te;export{ne as default}; \ No newline at end of file diff --git a/assets/cloudflare-workers-ai-C4yLEnia.js b/assets/cloudflare-workers-ai-Cso4_BGA.js similarity index 84% rename from assets/cloudflare-workers-ai-C4yLEnia.js rename to assets/cloudflare-workers-ai-Cso4_BGA.js index 9f93fa303b7829bc80d64b2762546e4ccd56dacb..2315c6eaf18611c210888e7cfde3e5617459094c 100644 --- a/assets/cloudflare-workers-ai-C4yLEnia.js +++ b/assets/cloudflare-workers-ai-Cso4_BGA.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAccountIdInput_default as p,ProviderApiKeyInput_default as m,ProviderBasicSettings_default as h,ProviderSettingsContainer_default as g,ProviderSettingsLayout_default as _}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as v}from"./route-block-CC3cgg4Q.js";const y=`cloudflare-workers-ai`;var b=r({__name:`cloudflare-workers-ai`,setup(r){let{t:v}=c(),b=l(),x=f(),{providers:S}=o(x),C=e(()=>x.getProviderMetadata(y)),w=e({get:()=>{var e;return(e=S.value[y])?.apiKey||``},set:e=>{S.value[y]||(S.value[y]={}),S.value[y].apiKey=e}}),T=e({get:()=>{var e;return(e=S.value[y])?.accountId||``},set:e=>{S.value[y]||(S.value[y]={}),S.value[y].accountId=e}});i(()=>{var e,t;x.initializeProvider(y),w.value=(e=S.value[y])?.apiKey||``,T.value=(t=S.value[y])?.accountId||``}),u([w,T],()=>{S.value[y]={...S.value[y],apiKey:w.value,accountId:T.value}});function E(){var e;S.value[y]={...(e=C.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(_),{"provider-name":(i=C.value)?.localizedName,"provider-icon-color":(o=C.value)?.iconColor,"on-back":()=>s(b).back()},{default:d(()=>[n(s(g),null,{default:d(()=>[n(s(h),{title:s(v)(`settings.pages.providers.common.section.basic.title`),description:s(v)(`settings.pages.providers.common.section.basic.description`),"on-reset":E},{default:d(()=>{var e;return[n(s(m),{modelValue:w.value,"onUpdate:modelValue":r[0]||=e=>w.value=e,"provider-name":(e=C.value)?.localizedName,placeholder:s(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder`)},null,8,[`modelValue`,`provider-name`,`placeholder`]),n(s(p),{modelValue:T.value,"onUpdate:modelValue":r[1]||=e=>T.value=e,label:s(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label`),description:s(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description`),placeholder:s(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder`)},null,8,[`modelValue`,`label`,`description`,`placeholder`])]}),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof v==`function`&&v(b);var x=b;export{x as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAccountIdInput_default as p,ProviderApiKeyInput_default as m,ProviderBasicSettings_default as h,ProviderSettingsContainer_default as g,ProviderSettingsLayout_default as _}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as v}from"./route-block-CC3cgg4Q.js";const y=`cloudflare-workers-ai`;var b=r({__name:`cloudflare-workers-ai`,setup(r){let{t:v}=c(),b=l(),x=f(),{providers:S}=o(x),C=e(()=>x.getProviderMetadata(y)),w=e({get:()=>{var e;return(e=S.value[y])?.apiKey||``},set:e=>{S.value[y]||(S.value[y]={}),S.value[y].apiKey=e}}),T=e({get:()=>{var e;return(e=S.value[y])?.accountId||``},set:e=>{S.value[y]||(S.value[y]={}),S.value[y].accountId=e}});i(()=>{var e,t;x.initializeProvider(y),w.value=(e=S.value[y])?.apiKey||``,T.value=(t=S.value[y])?.accountId||``}),u([w,T],()=>{S.value[y]={...S.value[y],apiKey:w.value,accountId:T.value}});function E(){var e;S.value[y]={...(e=C.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(_),{"provider-name":(i=C.value)?.localizedName,"provider-icon-color":(o=C.value)?.iconColor,"on-back":()=>s(b).back()},{default:d(()=>[n(s(g),null,{default:d(()=>[n(s(h),{title:s(v)(`settings.pages.providers.common.section.basic.title`),description:s(v)(`settings.pages.providers.common.section.basic.description`),"on-reset":E},{default:d(()=>{var e;return[n(s(m),{modelValue:w.value,"onUpdate:modelValue":r[0]||=e=>w.value=e,"provider-name":(e=C.value)?.localizedName,placeholder:s(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder`)},null,8,[`modelValue`,`provider-name`,`placeholder`]),n(s(p),{modelValue:T.value,"onUpdate:modelValue":r[1]||=e=>T.value=e,label:s(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label`),description:s(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description`),placeholder:s(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder`)},null,8,[`modelValue`,`label`,`description`,`placeholder`])]}),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof v==`function`&&v(b);var x=b;export{x as default}; \ No newline at end of file diff --git a/assets/color-scheme-BB8LYAOa.js b/assets/color-scheme-DpRkLhr5.js similarity index 90% rename from assets/color-scheme-BB8LYAOa.js rename to assets/color-scheme-DpRkLhr5.js index a6eadafbcdfc389fb6406ce61b1028d2bb496e2f..d8d169f443faa11657fccf9d47efe4279396db2d 100644 --- a/assets/color-scheme-BB8LYAOa.js +++ b/assets/color-scheme-DpRkLhr5.js @@ -1 +1 @@ -import{Fragment as e,__plugin_vue_export_helper_default as t,createBaseVNode as n,createBlock as r,createElementBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,openBlock as c,renderList as l,resolveDirective as u,toDisplayString as d,unref as f,useI18n as p,useSettings as m,vModelCheckbox as h,withCtx as g,withDirectives as _}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import{ColorHueRange_default as v}from"./src-CX9nVT7I.js";import"./dist-BziUufTI.js";import{Section_default as y}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as b}from"./route-block-CC3cgg4Q.js";import{ColorPalette_default as x}from"./ColorPalette-BdHvvd1C.js";var S=[[],[`#A5978B`,`#D8CAAF`,`#B8B4A7`,`#C4BCB1`,`#E5DED8`,`#9A8F7D`,`#BEB5A7`,`#C9C0B6`],[`#7A9EAF`,`#B8C7CC`,`#D4B79C`,`#8B9D77`,`#C7D5CB`,`#E6D0B1`,`#94A7B1`,`#B4C8C3`],[`#D9B48F`,`#B5917A`,`#8C7A6B`,`#A17F5F`,`#B98C46`,`#C7A252`,`#DAB300`,`#D19826`],[`#9BA7B0`,`#C1CBD4`,`#A5ADB6`,`#8B959E`,`#D4DCE4`,`#7F8A94`,`#B3BCC6`,`#98A4AE`],[`#E4C6D0`,`#A61B29`,`#5D513C`,`#789262`,`#1C0D1A`,`#F7C242`,`#62A9DD`,`#8C4B3C`]];const C={flex:``,"items-center":``,"justify-between":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:300,delay:5*50,transition:`all ease-in-out duration-250`},w={"text-lg":``,"font-semibold":``},T={relative:``,flex:``,"cursor-pointer":``,"items-center":``,"gap-2":``},E={class:`color-bar`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:320,delay:7*50,transition:`all ease-in-out duration-250`},D={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:8*50,transition:`all ease-in-out duration-250`},O={class:`color-bar transparency-grid`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:340,delay:9*50,transition:`all ease-in-out duration-250`},k=[`duration`,`delay`],A={"font-medium":``},j={text:`sm neutral-500`},M={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var N=s({__name:`color-scheme`,setup(t){let s=m(),{t:b}=p();return(t,p)=>{let m=u(`motion`);return c(),i(e,null,[_((c(),r(f(y),{"mb-2":``,title:f(b)(`settings.pages.themes.sections.section.custom-color.title`),icon:`i-solar:pallete-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:290,delay:4*50,transition:`all ease-in-out duration-250`},{default:g(()=>[_((c(),i(`div`,C,[n(`span`,w,d(t.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label`)),1),n(`label`,T,[_(n(`input`,{"onUpdate:modelValue":p[0]||=e=>f(s).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[h,f(s).themeColorsHueDynamic]]),p[2]||=n(`div`,{class:`h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 peer-checked:bg-primary-500 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white`},null,-1),a(` `+d(t.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[m]]),_(o(f(v),{modelValue:f(s).themeColorsHue,"onUpdate:modelValue":p[1]||=e=>f(s).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:6*50,disabled:f(s).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[m]]),_((c(),i(`div`,E,[p[4]||=n(`span`,{"bg-primary-50":``},`50`,-1),p[5]||=n(`span`,{"bg-primary-100":``},`100`,-1),p[6]||=n(`span`,{"bg-primary-200":``},`200`,-1),p[7]||=n(`span`,{"bg-primary-300":``},`300`,-1),p[8]||=n(`span`,{"bg-primary-400":``},`400`,-1),p[9]||=n(`span`,{"bg-primary-500":``},`500`,-1),_((c(),i(`div`,D,p[3]||=[n(`span`,{"bg-primary-600":``},`600`,-1),n(`span`,{"bg-primary-700":``},`700`,-1),n(`span`,{"bg-primary-800":``},`800`,-1),n(`span`,{"bg-primary-900":``},`900`,-1),n(`span`,{"bg-primary-950":``},`950`,-1)])),[[m]])])),[[m]]),_((c(),i(`div`,O,p[10]||=[n(`span`,{bg:`primary-500/5`},`500/5`,-1),n(`span`,{bg:`primary-500/10`},`500/10`,-1),n(`span`,{bg:`primary-500/20`},`500/20`,-1),n(`span`,{bg:`primary-500/30`},`500/30`,-1),n(`span`,{bg:`primary-500/40`},`500/40`,-1),n(`span`,{bg:`primary-500/50`},`500/50`,-1),n(`span`,{bg:`primary-500/60`},`500/60`,-1),n(`span`,{bg:`primary-500/70`},`500/70`,-1),n(`span`,{bg:`primary-500/80`},`500/80`,-1),n(`span`,{bg:`primary-500/90`},`500/90`,-1),n(`span`,{bg:`primary-500`},`500`,-1)])),[[m]])]),_:1},8,[`title`])),[[m]]),_((c(),r(f(y),{"mb-2":``,title:f(b)(`settings.pages.themes.sections.section.theme-presets.title`),icon:`i-solar:magic-stick-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:350,delay:10*50,transition:`all ease-in-out duration-250`},{default:g(()=>[(c(!0),i(e,null,l(t.$tm(`settings.pages.themes.sections.section.theme-presets.presets`),({title:e,description:r,colors:a},s)=>_((c(),i(`div`,{key:s,class:`w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:360+s*10,delay:11*50+s*50,transition:`all ease-in-out duration-250`},[n(`div`,null,[n(`span`,A,d(t.$rt(e)),1),n(`div`,j,d(t.$rt(r)),1)]),o(x,{colors:a.map((e,n)=>({hex:f(S)[s][n],name:t.$rt(e)}))},null,8,[`colors`])],8,k)),[[m]])),128))]),_:1},8,[`title`])),[[m]]),_((c(),i(`div`,M,p[11]||=[n(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)])),[[m]])],64)}}});typeof b==`function`&&b(N);var P=t(N,[[`__scopeId`,`data-v-29f357ba`]]);export{P as default}; \ No newline at end of file +import{Fragment as e,__plugin_vue_export_helper_default as t,createBaseVNode as n,createBlock as r,createElementBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,openBlock as c,renderList as l,resolveDirective as u,toDisplayString as d,unref as f,useI18n as p,useSettings as m,vModelCheckbox as h,withCtx as g,withDirectives as _}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import{ColorHueRange_default as v}from"./src-CmPNYgc5.js";import"./dist-B_AZqzk2.js";import{Section_default as y}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as b}from"./route-block-CC3cgg4Q.js";import{ColorPalette_default as x}from"./ColorPalette-BB1UoLey.js";var S=[[],[`#A5978B`,`#D8CAAF`,`#B8B4A7`,`#C4BCB1`,`#E5DED8`,`#9A8F7D`,`#BEB5A7`,`#C9C0B6`],[`#7A9EAF`,`#B8C7CC`,`#D4B79C`,`#8B9D77`,`#C7D5CB`,`#E6D0B1`,`#94A7B1`,`#B4C8C3`],[`#D9B48F`,`#B5917A`,`#8C7A6B`,`#A17F5F`,`#B98C46`,`#C7A252`,`#DAB300`,`#D19826`],[`#9BA7B0`,`#C1CBD4`,`#A5ADB6`,`#8B959E`,`#D4DCE4`,`#7F8A94`,`#B3BCC6`,`#98A4AE`],[`#E4C6D0`,`#A61B29`,`#5D513C`,`#789262`,`#1C0D1A`,`#F7C242`,`#62A9DD`,`#8C4B3C`]];const C={flex:``,"items-center":``,"justify-between":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:300,delay:5*50,transition:`all ease-in-out duration-250`},w={"text-lg":``,"font-semibold":``},T={relative:``,flex:``,"cursor-pointer":``,"items-center":``,"gap-2":``},E={class:`color-bar`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:320,delay:7*50,transition:`all ease-in-out duration-250`},D={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:8*50,transition:`all ease-in-out duration-250`},O={class:`color-bar transparency-grid`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:340,delay:9*50,transition:`all ease-in-out duration-250`},k=[`duration`,`delay`],A={"font-medium":``},j={text:`sm neutral-500`},M={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var N=s({__name:`color-scheme`,setup(t){let s=m(),{t:b}=p();return(t,p)=>{let m=u(`motion`);return c(),i(e,null,[_((c(),r(f(y),{"mb-2":``,title:f(b)(`settings.pages.themes.sections.section.custom-color.title`),icon:`i-solar:pallete-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:290,delay:4*50,transition:`all ease-in-out duration-250`},{default:g(()=>[_((c(),i(`div`,C,[n(`span`,w,d(t.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label`)),1),n(`label`,T,[_(n(`input`,{"onUpdate:modelValue":p[0]||=e=>f(s).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[h,f(s).themeColorsHueDynamic]]),p[2]||=n(`div`,{class:`h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 peer-checked:bg-primary-500 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white`},null,-1),a(` `+d(t.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[m]]),_(o(f(v),{modelValue:f(s).themeColorsHue,"onUpdate:modelValue":p[1]||=e=>f(s).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:6*50,disabled:f(s).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[m]]),_((c(),i(`div`,E,[p[4]||=n(`span`,{"bg-primary-50":``},`50`,-1),p[5]||=n(`span`,{"bg-primary-100":``},`100`,-1),p[6]||=n(`span`,{"bg-primary-200":``},`200`,-1),p[7]||=n(`span`,{"bg-primary-300":``},`300`,-1),p[8]||=n(`span`,{"bg-primary-400":``},`400`,-1),p[9]||=n(`span`,{"bg-primary-500":``},`500`,-1),_((c(),i(`div`,D,p[3]||=[n(`span`,{"bg-primary-600":``},`600`,-1),n(`span`,{"bg-primary-700":``},`700`,-1),n(`span`,{"bg-primary-800":``},`800`,-1),n(`span`,{"bg-primary-900":``},`900`,-1),n(`span`,{"bg-primary-950":``},`950`,-1)])),[[m]])])),[[m]]),_((c(),i(`div`,O,p[10]||=[n(`span`,{bg:`primary-500/5`},`500/5`,-1),n(`span`,{bg:`primary-500/10`},`500/10`,-1),n(`span`,{bg:`primary-500/20`},`500/20`,-1),n(`span`,{bg:`primary-500/30`},`500/30`,-1),n(`span`,{bg:`primary-500/40`},`500/40`,-1),n(`span`,{bg:`primary-500/50`},`500/50`,-1),n(`span`,{bg:`primary-500/60`},`500/60`,-1),n(`span`,{bg:`primary-500/70`},`500/70`,-1),n(`span`,{bg:`primary-500/80`},`500/80`,-1),n(`span`,{bg:`primary-500/90`},`500/90`,-1),n(`span`,{bg:`primary-500`},`500`,-1)])),[[m]])]),_:1},8,[`title`])),[[m]]),_((c(),r(f(y),{"mb-2":``,title:f(b)(`settings.pages.themes.sections.section.theme-presets.title`),icon:`i-solar:magic-stick-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:350,delay:10*50,transition:`all ease-in-out duration-250`},{default:g(()=>[(c(!0),i(e,null,l(t.$tm(`settings.pages.themes.sections.section.theme-presets.presets`),({title:e,description:r,colors:a},s)=>_((c(),i(`div`,{key:s,class:`w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:360+s*10,delay:11*50+s*50,transition:`all ease-in-out duration-250`},[n(`div`,null,[n(`span`,A,d(t.$rt(e)),1),n(`div`,j,d(t.$rt(r)),1)]),o(x,{colors:a.map((e,n)=>({hex:f(S)[s][n],name:t.$rt(e)}))},null,8,[`colors`])],8,k)),[[m]])),128))]),_:1},8,[`title`])),[[m]]),_((c(),i(`div`,M,p[11]||=[n(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)])),[[m]])],64)}}});typeof b==`function`&&b(N);var P=t(N,[[`__scopeId`,`data-v-29f357ba`]]);export{P as default}; \ No newline at end of file diff --git a/assets/components-DetbLrEi.js b/assets/components-BvWgWMX4.js similarity index 99% rename from assets/components-DetbLrEi.js rename to assets/components-BvWgWMX4.js index 682ea82a378074d414155ab2a65f41c6b0e0b553..8ebd7bfd14acbe8e2d54db092ded9d3894d5e633 100644 --- a/assets/components-DetbLrEi.js +++ b/assets/components-BvWgWMX4.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-CubORAmj.js","assets/__vite-browser-external-CoPuN2cl.js","assets/index-BSwg6FIo.js","assets/index-5P7QcyEX.css","assets/default-node-G9zSbWb2.js","assets/import-url-browser-CajlDqRn.js","assets/import-url-browser-DNuYZxPr.js","assets/duckdb-mvp-C3i5IjU8.js","assets/import-url-node-BGiLk3V8.js"])))=>i.map(i=>d[i]); -var e=function(exports){function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}return exports.defineProperty=i,exports}({});import{AdditiveBlending as t,AlwaysStencilFunc as n,AnimationMixer as r,Audio as i,AudioListener as a,AudioLoader as o,BackSide as s,Box2 as c,Box3 as l,BoxGeometry as u,BufferAttribute as d,BufferGeometry as f,CatmullRomCurve3 as p,ClampToEdgeWrapping as m,Color as h,CompressedTexture as g,CubeCamera as _,CubeReflectionMapping as v,CubeTextureLoader as y,CylinderGeometry as b,DataTexture as x,DataTextureLoader as S,DataUtils as C,DepthTexture as w,DoubleSide as T,EdgesGeometry as E,Ee as D,EquirectangularReflectionMapping as O,Euler as k,EventDispatcher as A,ExtrudeGeometry as j,FileLoader as M,Float32BufferAttribute as N,FloatType as ee,Fragment as P,FrontSide as F,Group as I,HalfFloatType as te,InstancedBufferGeometry as ne,InstancedInterleavedBuffer as L,InstancedMesh as re,InterleavedBuffer as R,InterleavedBufferAttribute as ie,InterpolateDiscrete as ae,InterpolateLinear as oe,Ir as se,Line as ce,Line3 as le,LineBasicMaterial as ue,LinearFilter as de,LinearMipmapLinearFilter as fe,LinearMipmapNearestFilter as pe,Loader as me,MOUSE as he,Material as ge,MathUtils as _e,Matrix3 as ve,Matrix4 as ye,Mesh as be,MeshBasicMaterial as xe,MeshDepthMaterial as Se,MeshStandardMaterial as Ce,MirroredRepeatWrapping as we,Mn as Te,NearestFilter as Ee,NearestMipmapLinearFilter as De,NearestMipmapNearestFilter as Oe,NoToneMapping as ke,Object3D as Ae,OctahedronGeometry as je,OrthographicCamera as Me,Path as Ne,PerspectiveCamera as Pe,Plane as Fe,PlaneGeometry as Ie,PropertyBinding as Le,Q as Re,QuadraticBezierCurve3 as ze,Quaternion as Be,REVISION as Ve,RGBAFormat as He,RawShaderMaterial as Ue,Ray as We,Raycaster as Ge,RepeatWrapping as Ke,ReplaceStencilOp as qe,Scene as Je,ShaderChunk as Ye,ShaderMaterial as Xe,Shape as Ze,ShapeGeometry as Qe,ShapePath as $e,ShapeUtils as et,SkinnedMesh as tt,Sphere as nt,SphereGeometry as rt,Spherical as it,TOUCH as at,Texture as ot,TextureLoader as st,TorusGeometry as ct,Triangle as lt,Uniform as ut,UniformsLib as dt,UniformsUtils as ft,Vector2 as pt,Vector3 as z,Vector4 as mt,Vn as ht,WebGLCubeRenderTarget as gt,WebGLRenderTarget as _t,WebGLRenderer as vt,WireframeGeometry as yt,__commonJSMin as bt,__export as xt,__plugin_vue_export_helper_default as St,__require as Ct,__toDynamicImportESM as wt,__toESM as Tt,__vitePreload as Et,breakpointsTailwind as Dt,computed as Ot,createBaseVNode as B,createBlock as kt,createCommentVNode as At,createElementBlock as V,createTextVNode as jt,createVNode as Mt,defineComponent as H,defu as Nt,dn as Pt,formatHex as Ft,getCurrentInstance as It,getCurrentScope as Lt,guardReactiveProps as Rt,io as zt,isReactive as Bt,isRef as Vt,mergeModels as Ht,mergeProps as Ut,nextTick as Wt,normalizeClass as Gt,normalizeProps as Kt,normalizeStyle as qt,onBeforeUnmount as Jt,onMounted as Yt,onScopeDispose as Xt,onUnmounted as Zt,openBlock as U,pe as Qt,reactive as $t,ref as W,render as en,renderList as tn,renderSlot as nn,resolveComponent as rn,resolveDirective as an,shallowReactive as on,shallowRef as sn,so as cn,storeToRefs as ln,toDisplayString as un,toRaw as dn,toRef as fn,toRefs as pn,toValue$1 as mn,unref as G,useAttrs as hn,useBreakpoints as gn,useDark as _n,useDebounceFn as vn,useElementBounding as yn,useI18n as bn,useModel as xn,useRouter as Sn,useSettings as Cn,useSlots as wn,useWindowSize as Tn,vModelCheckbox as En,vModelRadio as Dn,vModelSelect as On,vModelText as kn,watch as K,watchDebounced as An,watchEffect as jn,withAsyncContext as Mn,withCtx as Nn,withDirectives as Pn,withModifiers as Fn}from"./index-BSwg6FIo.js";import{getImportUrlBundles as In}from"./import-url-browser-DNuYZxPr.js";import{generateSpeech as Ln,useAudioContext as Rn,useChatStore as zn,useProvidersStore as Bn,useSpeakingStore as Vn,useSpeechStore as Hn}from"./stores-BzkLfyIH.js";import{Collapsable_default as Un,TransitionVertical_default as Wn}from"./Button-AEge-Qyg.js";import{FieldCheckbox_default as Gn,FieldInput_default as Kn,Input_default as qn}from"./src-CX9nVT7I.js";import{VRMUtils as Jn,clipFromVRMAnimation as Yn,lerp as Xn,loadVRMAnimation as Zn,loadVrm as Qn,randFloat as $n,randomSaccadeInterval as er,useBlink as tr,useIdleEyeSaccades as nr,useMarkdown as rr,useVRMEmote as ir}from"./composables-BpmQTBvS.js";import{useQueue as ar}from"./queue-Cw0r8hJ-.js";import{EMOTION_EmotionMotionName_value as or,EMOTION_VRMExpressionName_value as sr,EmotionThinkMotionName as cr,llmInferenceEndToken as lr,useDelayMessageQueue as ur,useEmotionsMessageQueue as dr,useMessageContentQueue as fr}from"./queues-XZuprNy-.js";var pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i;let ea,ta,na,ra;var ia=H({__name:`AudioSpectrum`,props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(e){let t=e,n=W(Array.from({length:t.bars}).fill(0));Yt(()=>{r()}),K(()=>t.stream,()=>{r()});function r(){if(!t.stream)return;let e=new(window.AudioContext||window.webkitAudioContext),r=e.createMediaStreamSource(t.stream),i=e.createAnalyser();i.fftSize=2048,r.connect(i);let a=i.frequencyBinCount,o=new Uint8Array(a),s=e.sampleRate,c=s/i.fftSize,l=Math.floor(t.minFreq/c),u=Math.floor(t.maxFreq/c),d=u-l,f=Math.floor(d/t.bars),p=()=>{try{requestAnimationFrame(p),i.getByteFrequencyData(o);let e=Array.from({length:t.bars}).fill(0);for(let n=0;nnn(e.$slots,`default`,{frequencies:n.value})}}),aa=ia;const oa={"h-full":``,flex:``,"items-center":``,"gap-1":``},sa=5;var ca=H({__name:`AudioSpectrumVisualizer`,props:{frequencies:null,barsClass:null},setup(e){let t=e;function n(e,t){let n=.1,r=1;return n+(r-n)*(e/t)}function r(e,r){let i=n(r,t.frequencies.length);return Math.min(100,Math.max(10,e*100*sa*i))}return(t,n)=>(U(),V(`div`,oa,[(U(!0),V(P,null,tn(e.frequencies,(t,n)=>(U(),V(`div`,{key:n,"h-full":``,flex:``,"flex-1":``,"items-end":``},[B(`div`,{transition:`all 100 ease-in-out`,"mx-auto":``,"my-0":``,"w-full":``,"rounded-full":``,class:Gt(e.barsClass),style:qt({height:`${r(t,n)}%`})},null,6)]))),128))]))}}),la=ca,ua=H({__name:`Volumed`,props:{perspective:null,transform:null},setup(e){return(t,n)=>(U(),V(`div`,{class:`volumed`,style:qt({perspective:`${e.perspective}px`,transform:e.transform})},[nn(t.$slots,`default`,{},void 0,!0)],4))}}),da=St(ua,[[`__scopeId`,`data-v-568551bc`]]),fa=H({__name:`CursorMomentum`,props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(e,{expose:t}){let n=e,r=W(1),i=W(0),a=0,o=fn(()=>n.friction),s=fn(()=>n.baseSpeed),c=fn(()=>n.momentumFactor);function l(e){a||=e;let t=e-a;a=e,r.value=s.value+(r.value-s.value)*o.value,i.value+=r.value*t,requestAnimationFrame(l)}function u(e){let t=Math.sqrt(e.movementX**2+e.movementY**2);r.value+=t*c.value}return Yt(()=>{window.addEventListener(`mousemove`,u),requestAnimationFrame(l)}),Zt(()=>{window.removeEventListener(`mousemove`,u)}),t({momentum:r,currentValue:i}),(e,t)=>nn(e.$slots,`default`,{momentum:r.value,currentValue:i.value})}}),pa=fa,ma=H({__name:`TestDummyMarkerFlat`,props:{size:null},setup(e){return(t,n)=>(U(),V(`div`,{class:`test-dummy-flat`,style:qt({width:`${e.size}px`,height:`${e.size}px`})},n[0]||=[B(`div`,{class:`marker`},null,-1)],4))}}),ha=St(ma,[[`__scopeId`,`data-v-b4ef37ac`]]),ga=H({__name:`TestDummyMarker`,setup(e){return(e,t)=>(U(),kt(pa,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:Nn(({currentValue:e})=>[Mt(da,{perspective:800,transform:`rotateX(45deg) translateY(3px)`},{default:Nn(()=>[Mt(ha,{size:24,style:qt({transform:`rotate(${e}deg)`})},null,8,[`style`])]),_:2},1024)]),_:1}))}}),_a=ga,va;(function(e){e[e.WEBGL_LEGACY=0]=`WEBGL_LEGACY`,e[e.WEBGL=1]=`WEBGL`,e[e.WEBGL2=2]=`WEBGL2`})(va||={});var ya;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.WEBGL=1]=`WEBGL`,e[e.CANVAS=2]=`CANVAS`})(ya||={});var ba;(function(e){e[e.COLOR=16384]=`COLOR`,e[e.DEPTH=256]=`DEPTH`,e[e.STENCIL=1024]=`STENCIL`})(ba||={});var xa;(function(e){e[e.NORMAL=0]=`NORMAL`,e[e.ADD=1]=`ADD`,e[e.MULTIPLY=2]=`MULTIPLY`,e[e.SCREEN=3]=`SCREEN`,e[e.OVERLAY=4]=`OVERLAY`,e[e.DARKEN=5]=`DARKEN`,e[e.LIGHTEN=6]=`LIGHTEN`,e[e.COLOR_DODGE=7]=`COLOR_DODGE`,e[e.COLOR_BURN=8]=`COLOR_BURN`,e[e.HARD_LIGHT=9]=`HARD_LIGHT`,e[e.SOFT_LIGHT=10]=`SOFT_LIGHT`,e[e.DIFFERENCE=11]=`DIFFERENCE`,e[e.EXCLUSION=12]=`EXCLUSION`,e[e.HUE=13]=`HUE`,e[e.SATURATION=14]=`SATURATION`,e[e.COLOR=15]=`COLOR`,e[e.LUMINOSITY=16]=`LUMINOSITY`,e[e.NORMAL_NPM=17]=`NORMAL_NPM`,e[e.ADD_NPM=18]=`ADD_NPM`,e[e.SCREEN_NPM=19]=`SCREEN_NPM`,e[e.NONE=20]=`NONE`,e[e.SRC_OVER=0]=`SRC_OVER`,e[e.SRC_IN=21]=`SRC_IN`,e[e.SRC_OUT=22]=`SRC_OUT`,e[e.SRC_ATOP=23]=`SRC_ATOP`,e[e.DST_OVER=24]=`DST_OVER`,e[e.DST_IN=25]=`DST_IN`,e[e.DST_OUT=26]=`DST_OUT`,e[e.DST_ATOP=27]=`DST_ATOP`,e[e.ERASE=26]=`ERASE`,e[e.SUBTRACT=28]=`SUBTRACT`,e[e.XOR=29]=`XOR`})(xa||={});var Sa;(function(e){e[e.POINTS=0]=`POINTS`,e[e.LINES=1]=`LINES`,e[e.LINE_LOOP=2]=`LINE_LOOP`,e[e.LINE_STRIP=3]=`LINE_STRIP`,e[e.TRIANGLES=4]=`TRIANGLES`,e[e.TRIANGLE_STRIP=5]=`TRIANGLE_STRIP`,e[e.TRIANGLE_FAN=6]=`TRIANGLE_FAN`})(Sa||={});var Ca;(function(e){e[e.RGBA=6408]=`RGBA`,e[e.RGB=6407]=`RGB`,e[e.RG=33319]=`RG`,e[e.RED=6403]=`RED`,e[e.RGBA_INTEGER=36249]=`RGBA_INTEGER`,e[e.RGB_INTEGER=36248]=`RGB_INTEGER`,e[e.RG_INTEGER=33320]=`RG_INTEGER`,e[e.RED_INTEGER=36244]=`RED_INTEGER`,e[e.ALPHA=6406]=`ALPHA`,e[e.LUMINANCE=6409]=`LUMINANCE`,e[e.LUMINANCE_ALPHA=6410]=`LUMINANCE_ALPHA`,e[e.DEPTH_COMPONENT=6402]=`DEPTH_COMPONENT`,e[e.DEPTH_STENCIL=34041]=`DEPTH_STENCIL`})(Ca||={});var wa;(function(e){e[e.TEXTURE_2D=3553]=`TEXTURE_2D`,e[e.TEXTURE_CUBE_MAP=34067]=`TEXTURE_CUBE_MAP`,e[e.TEXTURE_2D_ARRAY=35866]=`TEXTURE_2D_ARRAY`,e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=`TEXTURE_CUBE_MAP_POSITIVE_X`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=`TEXTURE_CUBE_MAP_NEGATIVE_X`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=`TEXTURE_CUBE_MAP_POSITIVE_Y`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=`TEXTURE_CUBE_MAP_NEGATIVE_Y`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=`TEXTURE_CUBE_MAP_POSITIVE_Z`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=`TEXTURE_CUBE_MAP_NEGATIVE_Z`})(wa||={});var Ta;(function(e){e[e.UNSIGNED_BYTE=5121]=`UNSIGNED_BYTE`,e[e.UNSIGNED_SHORT=5123]=`UNSIGNED_SHORT`,e[e.UNSIGNED_SHORT_5_6_5=33635]=`UNSIGNED_SHORT_5_6_5`,e[e.UNSIGNED_SHORT_4_4_4_4=32819]=`UNSIGNED_SHORT_4_4_4_4`,e[e.UNSIGNED_SHORT_5_5_5_1=32820]=`UNSIGNED_SHORT_5_5_5_1`,e[e.UNSIGNED_INT=5125]=`UNSIGNED_INT`,e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]=`UNSIGNED_INT_10F_11F_11F_REV`,e[e.UNSIGNED_INT_2_10_10_10_REV=33640]=`UNSIGNED_INT_2_10_10_10_REV`,e[e.UNSIGNED_INT_24_8=34042]=`UNSIGNED_INT_24_8`,e[e.UNSIGNED_INT_5_9_9_9_REV=35902]=`UNSIGNED_INT_5_9_9_9_REV`,e[e.BYTE=5120]=`BYTE`,e[e.SHORT=5122]=`SHORT`,e[e.INT=5124]=`INT`,e[e.FLOAT=5126]=`FLOAT`,e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=`FLOAT_32_UNSIGNED_INT_24_8_REV`,e[e.HALF_FLOAT=36193]=`HALF_FLOAT`})(Ta||={});var Ea;(function(e){e[e.FLOAT=0]=`FLOAT`,e[e.INT=1]=`INT`,e[e.UINT=2]=`UINT`})(Ea||={});var Da;(function(e){e[e.NEAREST=0]=`NEAREST`,e[e.LINEAR=1]=`LINEAR`})(Da||={});var Oa;(function(e){e[e.CLAMP=33071]=`CLAMP`,e[e.REPEAT=10497]=`REPEAT`,e[e.MIRRORED_REPEAT=33648]=`MIRRORED_REPEAT`})(Oa||={});var ka;(function(e){e[e.OFF=0]=`OFF`,e[e.POW2=1]=`POW2`,e[e.ON=2]=`ON`,e[e.ON_MANUAL=3]=`ON_MANUAL`})(ka||={});var Aa;(function(e){e[e.NPM=0]=`NPM`,e[e.UNPACK=1]=`UNPACK`,e[e.PMA=2]=`PMA`,e[e.NO_PREMULTIPLIED_ALPHA=0]=`NO_PREMULTIPLIED_ALPHA`,e[e.PREMULTIPLY_ON_UPLOAD=1]=`PREMULTIPLY_ON_UPLOAD`,e[e.PREMULTIPLY_ALPHA=2]=`PREMULTIPLY_ALPHA`,e[e.PREMULTIPLIED_ALPHA=2]=`PREMULTIPLIED_ALPHA`})(Aa||={});var ja;(function(e){e[e.NO=0]=`NO`,e[e.YES=1]=`YES`,e[e.AUTO=2]=`AUTO`,e[e.BLEND=0]=`BLEND`,e[e.CLEAR=1]=`CLEAR`,e[e.BLIT=2]=`BLIT`})(ja||={});var Ma;(function(e){e[e.AUTO=0]=`AUTO`,e[e.MANUAL=1]=`MANUAL`})(Ma||={});var Na;(function(e){e.LOW=`lowp`,e.MEDIUM=`mediump`,e.HIGH=`highp`})(Na||={});var Pa;(function(e){e[e.NONE=0]=`NONE`,e[e.SCISSOR=1]=`SCISSOR`,e[e.STENCIL=2]=`STENCIL`,e[e.SPRITE=3]=`SPRITE`,e[e.COLOR=4]=`COLOR`})(Pa||={});var Fa;(function(e){e[e.RED=1]=`RED`,e[e.GREEN=2]=`GREEN`,e[e.BLUE=4]=`BLUE`,e[e.ALPHA=8]=`ALPHA`})(Fa||={});var Ia;(function(e){e[e.NONE=0]=`NONE`,e[e.LOW=2]=`LOW`,e[e.MEDIUM=4]=`MEDIUM`,e[e.HIGH=8]=`HIGH`})(Ia||={});var La;(function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]=`ELEMENT_ARRAY_BUFFER`,e[e.ARRAY_BUFFER=34962]=`ARRAY_BUFFER`,e[e.UNIFORM_BUFFER=35345]=`UNIFORM_BUFFER`})(La||={});var Ra={createCanvas:function(e,t){var n=document.createElement(`canvas`);return n.width=e,n.height=t,n},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var e;return(e=document.baseURI)??window.location.href},fetch:function(e,t){return fetch(e,t)}},za=/iPhone/i,Ba=/iPod/i,Va=/iPad/i,Ha=/\biOS-universal(?:.+)Mac\b/i,Ua=/\bAndroid(?:.+)Mobile\b/i,Wa=/Android/i,Ga=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Ka=/Silk/i,qa=/Windows Phone/i,Ja=/\bWindows(?:.+)ARM\b/i,Ya=/BlackBerry/i,Xa=/BB10/i,Za=/Opera Mini/i,Qa=/\b(CriOS|Chrome)(?:.+)Mobile/i,$a=/Mobile(?:.+)Firefox\b/i,eo=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function to(e){return function(t){return t.test(e)}}function no(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=to(n),a={apple:{phone:i(za)&&!i(qa),ipod:i(Ba),tablet:!i(za)&&(i(Va)||eo(t))&&!i(qa),universal:i(Ha),device:(i(za)||i(Ba)||i(Va)||i(Ha)||eo(t))&&!i(qa)},amazon:{phone:i(Ga),tablet:!i(Ga)&&i(Ka),device:i(Ga)||i(Ka)},android:{phone:!i(qa)&&i(Ga)||!i(qa)&&i(Ua),tablet:!i(qa)&&!i(Ga)&&!i(Ua)&&(i(Ka)||i(Wa)),device:!i(qa)&&(i(Ga)||i(Ka)||i(Ua)||i(Wa))||i(/\bokhttp\b/i)},windows:{phone:i(qa),tablet:i(Ja),device:i(qa)||i(Ja)},other:{blackberry:i(Ya),blackberry10:i(Xa),opera:i(Za),firefox:i($a),chrome:i(Qa),device:i(Ya)||i(Xa)||i(Za)||i($a)||i(Qa)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var ro=no(globalThis.navigator);function io(){return!ro.apple.device}function ao(e){var t=!0;if(ro.tablet||ro.phone){if(ro.apple.device){var n=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(n){var r=parseInt(n[1],10);r<11&&(t=!1)}}if(ro.android.device){var n=navigator.userAgent.match(/Android\s([0-9.]*)/);if(n){var r=parseInt(n[1],10);r<7&&(t=!1)}}}return t?e:4}var oo={ADAPTER:Ra,MIPMAP_TEXTURES:ka.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:Ia.NONE,SPRITE_MAX_TEXTURES:ao(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:Ma.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Oa.CLAMP,SCALE_MODE:Da.LINEAR,PRECISION_VERTEX:Na.HIGH,PRECISION_FRAGMENT:ro.apple.device?Na.HIGH:Na.MEDIUM,CAN_UPLOAD_SAME_BUFFER:io(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},so=bt((exports,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{t.exports=n,t.exports.default=n;function n(e,t,n){n||=2;var i=t&&t.length,o=i?t[0]*n:e.length,s=r(e,0,o,n,!0),c=[];if(!s||s.next===s.prev)return c;var l,d,f,p,m,h,g;if(i&&(s=u(e,t,s,n)),e.length>80*n){l=f=e[0],d=p=e[1];for(var _=n;_f&&(f=m),h>p&&(p=h);g=Math.max(f-l,p-d),g=g===0?0:32767/g}return a(s,c,n,l,d,g,0),c}function r(e,t,n,r,i){var a,o;if(i===N(e,t,n,r)>0)for(a=t;a=t;a-=r)o=A(a,e[a],e[a+1],o);return o&&S(o,o.next)&&(j(o),o=o.next),o}function i(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(S(n,n.next)||x(n.prev,n,n.next)===0)){if(j(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function a(e,t,n,r,u,d,f){if(e){!f&&d&&h(e,r,u,d);for(var p=e,m,g;e.prev!==e.next;){if(m=e.prev,g=e.next,d?s(e,r,u,d):o(e)){t.push(m.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),j(e),e=g.next,p=g.next;continue}if(e=g,e===p){f?f===1?(e=c(i(e),t,n),a(e,t,n,r,u,d,2)):f===2&&l(e,t,n,r,u,d):a(i(e),t,n,r,u,d,1);break}}}}function o(e){var t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=ia?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&y(i,s,a,c,o,l,m.x,m.y)&&x(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,r){var i=e.prev,a=e,o=e.next;if(x(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=sc?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,v=_(p,m,t,n,r),b=_(h,g,t,n,r),S=e.prevZ,C=e.nextZ;S&&S.z>=v&&C&&C.z<=b;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0||(S=S.prevZ,C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;S&&S.z>=v;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;C&&C.z<=b;){if(C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!S(a,o)&&C(a,r,r.next,o)&&D(a,o)&&D(o,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),j(r),j(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,r,o,s){var c=e;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&b(c,l)){var u=k(c,l);c=i(c,c.next),u=i(u,u.next),a(c,t,n,r,o,s,0),a(u,t,n,r,o,s,0);return}l=l.next}c=c.next}while(c!==e)}function u(e,t,n,i){var a=[],o,s,c,l,u;for(o=0,s=t.length;o=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x=n.x&&n.x>=l&&r!==n.x&&y(io.x||n.x===o.x&&m(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function m(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function h(e,t,n,r){var i=e;do i.z===0&&(i.z=_(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function _(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function v(e){var t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function b(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&(D(e,t)&&D(t,e)&&O(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||S(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,n,r){var i=T(x(e,t,n)),a=T(x(e,t,r)),o=T(x(n,r,e)),s=T(x(n,r,t));return!!(i!==a&&o!==s||i===0&&w(e,n,t)||a===0&&w(e,r,t)||o===0&&w(n,e,r)||s===0&&w(n,t,r))}function w(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&C(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function D(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function k(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function A(e,t,n,r){var i=new M(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(N(e,0,a,n));if(i)for(var s=0,c=t.length;s0&&(r+=e[i-1].length,n.holes.push(r))}return n}}),lo=bt((exports,t)=>{(function(n){var r=typeof exports==`object`&&exports&&!exports.nodeType&&exports,i=typeof t==`object`&&t&&!t.nodeType&&t,a=typeof global==`object`&&global;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,c=36,l=1,u=26,d=38,f=700,p=72,m=128,h=`-`,g=/^xn--/,_=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},b=c-l,x=Math.floor,S=String.fromCharCode,C;function w(e){throw RangeError(y[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(v,`.`);var i=e.split(`.`),a=T(i,t).join(`.`);return r+a}function D(e){for(var t=[],n=0,r=e.length,i,a;n=55296&&i<=56319&&n65535&&(e-=65536,t+=S(e>>>10&1023|55296),e=56320|e&1023),t+=S(e),t}).join(``)}function k(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function A(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function j(e,t,n){var r=0;for(e=n?x(e/f):e>>1,e+=x(e/t);e>b*u>>1;r+=c)e=x(e/b);return x(r+(b+1)*e/(e+d))}function M(e){var t=[],n=e.length,r,i=0,a=m,o=p,d,f,g,_,v,y,b,S,C;for(d=e.lastIndexOf(h),d<0&&(d=0),f=0;f=128&&w(`not-basic`),t.push(e.charCodeAt(f));for(g=d>0?d+1:0;g=n&&w(`invalid-input`),b=k(e.charCodeAt(g++)),(b>=c||b>x((s-i)/v))&&w(`overflow`),i+=b*v,S=y<=o?l:y>=o+u?u:y-o,!(bx(s/C)&&w(`overflow`),v*=C;r=t.length+1,o=j(i-_,r,_==0),x(i/r)>s-a&&w(`overflow`),a+=x(i/r),i%=r,t.splice(i++,0,a)}return O(t)}function N(e){var t,n,r,i,a,o,d,f,g,_,v,y=[],b,C,T,E;for(e=D(e),b=e.length,t=m,n=0,a=p,o=0;o=t&&vx((s-n)/C)&&w(`overflow`),n+=(d-t)*C,t=d,o=0;os&&w(`overflow`),v==t){for(f=n,g=c;_=g<=a?l:g>=a+u?u:g-a,!(f<_);g+=c)E=f-_,T=c-_,y.push(S(A(_+E%T,0))),f=x(E/T);y.push(S(A(f,0))),a=j(n,C,r==i),n=0,++r}++n,++t}return y.join(``)}function ee(e){return E(e,function(e){return g.test(e)?M(e.slice(4).toLowerCase()):e})}function P(e){return E(e,function(e){return _.test(e)?`xn--`+N(e):e})}if(o={version:`1.4.1`,ucs2:{decode:D,encode:O},decode:M,encode:N,toASCII:P,toUnicode:ee},typeof define==`function`&&typeof define.amd==`object`&&define.amd)define(`punycode`,function(){return o});else if(r&&i)if(t.exports==r)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(r[C]=o[C]);else n.punycode=o})(void 0)}),uo=bt((exports,t)=>{Object.defineProperty(exports,`__esModule`,{value:!0});function n(){let e,t,n=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.get(n)}else if(t)return t.get(n)},r=(n,r)=>{n&&(typeof n==`object`||typeof n==`function`)?(e||=new WeakMap,e.set(n,r)):(t||=new Map,t.set(n,r))},i=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.has(n)}else if(t)return t.has(n);return!1},a=e=>{if(!i(e))throw TypeError(`Side channel does not contain the given key`)};return{get:n,set:r,has:i,assert:a}}exports.default=n,(typeof exports.default==`object`&&exports.default!==null||typeof exports.default==`function`)&&(Object.assign(exports.default,exports),t.exports=exports.default)}),fo=bt((exports,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:`RFC1738`,RFC3986:`RFC3986`};t.exports={default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,r,`+`)},RFC3986:function(e){return String(e)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}}),po=bt((exports,t)=>{var n=fo(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e}(),o=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],a=0;a=d?s.slice(l,l+d):s,f=[],p=0;p=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||o===n.RFC1738&&(m===40||m===41)){f[f.length]=u.charAt(p);continue}if(m<128){f[f.length]=a[m];continue}if(m<2048){f[f.length]=a[192|m>>6]+a[128|m&63];continue}if(m<55296||m>=57344){f[f.length]=a[224|m>>12]+a[128|m>>6&63]+a[128|m&63];continue}p+=1,m=65536+((m&1023)<<10|u.charCodeAt(p)&1023),f[f.length]=a[240|m>>18]+a[128|m>>12&63]+a[128|m>>6&63]+a[128|m&63]}c+=f.join(``)}return c},p=function(e){for(var t=[{obj:{o:e},prop:`o`}],n=[],r=0;r{var n=uo(),r=po(),i=fo(),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,commaRoundTrip:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},m={},h=function e(t,i,a,o,c,u,d,h,g,_,v,y,b,x,S,C,w,T){for(var E=t,D=T,O=0,k=!1;(D=D.get(m))!==void 0&&!k;){var A=D.get(t);if(O+=1,A!==void 0){if(A===O)throw RangeError(`Cyclic object value`);k=!0}D.get(m)===void 0&&(O=0)}if(typeof _==`function`?E=_(i,E):E instanceof Date?E=b(E):a===`comma`&&s(E)&&(E=r.maybeMap(E,function(e){return e instanceof Date?b(e):e})),E===null){if(u)return g&&!C?g(i,f.encoder,w,`key`,x):i;E=``}if(p(E)||r.isBuffer(E)){if(g){var j=C?i:g(i,f.encoder,w,`key`,x);return[S(j)+`=`+S(g(E,f.encoder,w,`value`,x))]}return[S(i)+`=`+S(String(E))]}var M=[];if(E===void 0)return M;var N;if(a===`comma`&&s(E))C&&g&&(E=r.maybeMap(E,g)),N=[{value:E.length>0?E.join(`,`)||null:void 0}];else if(s(_))N=_;else{var ee=Object.keys(E);N=v?ee.sort(v):ee}var P=h?String(i).replace(/\./g,`%2E`):String(i),F=o&&s(E)&&E.length===1?P+`[]`:P;if(c&&s(E)&&E.length===0)return F+`[]`;for(var I=0;I0?b+y:``}}),ho=bt((exports,t)=>{var n=po(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1)return e.split(`,`);if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);return e},c=`utf8=%26%2310003%3B`,l=`utf8=%E2%9C%93`,u=function(e,t){var u={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,``):e;d=d.replace(/%5B/gi,`[`).replace(/%5D/gi,`]`);var f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,t.throwOnLimitExceeded?f+1:f);if(t.throwOnLimitExceeded&&p.length>f)throw RangeError(`Parameter limit exceeded. Only `+f+` parameter`+(f===1?``:`s`)+` allowed.`);var m=-1,h,g=t.charset;if(t.charsetSentinel)for(h=0;h-1&&(x=i(x)?[x]:x);var S=r.call(u,b);S&&t.duplicates===`combine`?u[b]=n.combine(u[b],x):(!S||t.duplicates===`last`)&&(u[b]=x)}return u},d=function(e,t,r,i){var a=0;if(e.length>0&&e[e.length-1]===`[]`){var o=e.slice(0,-1).join(``);a=Array.isArray(t)&&t[o]?t[o].length:0}for(var c=i?t:s(t,r,a),l=e.length-1;l>=0;--l){var u,d=e[l];if(d===`[]`&&r.parseArrays)u=r.allowEmptyArrays&&(c===``||r.strictNullHandling&&c===null)?[]:n.combine([],c);else{u=r.plainObjects?{__proto__:null}:{};var f=d.charAt(0)===`[`&&d.charAt(d.length-1)===`]`?d.slice(1,-1):d,p=r.decodeDotInKeys?f.replace(/%2E/g,`.`):f,m=parseInt(p,10);!r.parseArrays&&p===``?u={0:c}:!isNaN(m)&&d!==p&&String(m)===p&&m>=0&&r.parseArrays&&m<=r.arrayLimit?(u=[],u[m]=c):p!==`__proto__`&&(u[p]=c)}c=u}return c},f=function(e,t,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(a),l=c?a.slice(0,c.index):a,u=[];if(l){if(!n.plainObjects&&r.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var f=0;n.depth>0&&(c=s.exec(a))!==null&&f{var n=mo(),r=ho(),i=fo();t.exports={formats:i,parse:r,stringify:n}}),_o=bt(exports=>{var t=lo();function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=[`<`,`>`,`"`,"`",` `,`\r`,` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-Dxcx6a0k.js","assets/__vite-browser-external-FU9M8lFq.js","assets/index-DKziOBM4.js","assets/index-5P7QcyEX.css","assets/default-node-q82Mf43j.js","assets/import-url-browser-CajlDqRn.js","assets/import-url-browser-DNuYZxPr.js","assets/duckdb-mvp-C3i5IjU8.js","assets/import-url-node-BGiLk3V8.js"])))=>i.map(i=>d[i]); +var e=function(exports){function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}return exports.defineProperty=i,exports}({});import{AdditiveBlending as t,AlwaysStencilFunc as n,AnimationMixer as r,Audio as i,AudioListener as a,AudioLoader as o,BackSide as s,Box2 as c,Box3 as l,BoxGeometry as u,BufferAttribute as d,BufferGeometry as f,CatmullRomCurve3 as p,ClampToEdgeWrapping as m,Color as h,CompressedTexture as g,CubeCamera as _,CubeReflectionMapping as v,CubeTextureLoader as y,CylinderGeometry as b,DataTexture as x,DataTextureLoader as S,DataUtils as C,DepthTexture as w,DoubleSide as T,EdgesGeometry as E,Ee as D,EquirectangularReflectionMapping as O,Euler as k,EventDispatcher as A,ExtrudeGeometry as j,FileLoader as M,Float32BufferAttribute as N,FloatType as ee,Fragment as P,FrontSide as F,Group as I,HalfFloatType as te,InstancedBufferGeometry as ne,InstancedInterleavedBuffer as L,InstancedMesh as re,InterleavedBuffer as R,InterleavedBufferAttribute as ie,InterpolateDiscrete as ae,InterpolateLinear as oe,Ir as se,Line as ce,Line3 as le,LineBasicMaterial as ue,LinearFilter as de,LinearMipmapLinearFilter as fe,LinearMipmapNearestFilter as pe,Loader as me,MOUSE as he,Material as ge,MathUtils as _e,Matrix3 as ve,Matrix4 as ye,Mesh as be,MeshBasicMaterial as xe,MeshDepthMaterial as Se,MeshStandardMaterial as Ce,MirroredRepeatWrapping as we,Mn as Te,NearestFilter as Ee,NearestMipmapLinearFilter as De,NearestMipmapNearestFilter as Oe,NoToneMapping as ke,Object3D as Ae,OctahedronGeometry as je,OrthographicCamera as Me,Path as Ne,PerspectiveCamera as Pe,Plane as Fe,PlaneGeometry as Ie,PropertyBinding as Le,Q as Re,QuadraticBezierCurve3 as ze,Quaternion as Be,REVISION as Ve,RGBAFormat as He,RawShaderMaterial as Ue,Ray as We,Raycaster as Ge,RepeatWrapping as Ke,ReplaceStencilOp as qe,Scene as Je,ShaderChunk as Ye,ShaderMaterial as Xe,Shape as Ze,ShapeGeometry as Qe,ShapePath as $e,ShapeUtils as et,SkinnedMesh as tt,Sphere as nt,SphereGeometry as rt,Spherical as it,TOUCH as at,Texture as ot,TextureLoader as st,TorusGeometry as ct,Triangle as lt,Uniform as ut,UniformsLib as dt,UniformsUtils as ft,Vector2 as pt,Vector3 as z,Vector4 as mt,Vn as ht,WebGLCubeRenderTarget as gt,WebGLRenderTarget as _t,WebGLRenderer as vt,WireframeGeometry as yt,__commonJSMin as bt,__export as xt,__plugin_vue_export_helper_default as St,__require as Ct,__toDynamicImportESM as wt,__toESM as Tt,__vitePreload as Et,breakpointsTailwind as Dt,computed as Ot,createBaseVNode as B,createBlock as kt,createCommentVNode as At,createElementBlock as V,createTextVNode as jt,createVNode as Mt,defineComponent as H,defu as Nt,dn as Pt,formatHex as Ft,getCurrentInstance as It,getCurrentScope as Lt,guardReactiveProps as Rt,io as zt,isReactive as Bt,isRef as Vt,mergeModels as Ht,mergeProps as Ut,nextTick as Wt,normalizeClass as Gt,normalizeProps as Kt,normalizeStyle as qt,onBeforeUnmount as Jt,onMounted as Yt,onScopeDispose as Xt,onUnmounted as Zt,openBlock as U,pe as Qt,reactive as $t,ref as W,render as en,renderList as tn,renderSlot as nn,resolveComponent as rn,resolveDirective as an,shallowReactive as on,shallowRef as sn,so as cn,storeToRefs as ln,toDisplayString as un,toRaw as dn,toRef as fn,toRefs as pn,toValue$1 as mn,unref as G,useAttrs as hn,useBreakpoints as gn,useDark as _n,useDebounceFn as vn,useElementBounding as yn,useI18n as bn,useModel as xn,useRouter as Sn,useSettings as Cn,useSlots as wn,useWindowSize as Tn,vModelCheckbox as En,vModelRadio as Dn,vModelSelect as On,vModelText as kn,watch as K,watchDebounced as An,watchEffect as jn,withAsyncContext as Mn,withCtx as Nn,withDirectives as Pn,withModifiers as Fn}from"./index-DKziOBM4.js";import{getImportUrlBundles as In}from"./import-url-browser-DNuYZxPr.js";import{generateSpeech as Ln,useAudioContext as Rn,useChatStore as zn,useProvidersStore as Bn,useSpeakingStore as Vn,useSpeechStore as Hn}from"./stores-zsAuCjXz.js";import{Collapsable_default as Un,TransitionVertical_default as Wn}from"./Button-DdtiAfEa.js";import{FieldCheckbox_default as Gn,FieldInput_default as Kn,Input_default as qn}from"./src-CmPNYgc5.js";import{VRMUtils as Jn,clipFromVRMAnimation as Yn,lerp as Xn,loadVRMAnimation as Zn,loadVrm as Qn,randFloat as $n,randomSaccadeInterval as er,useBlink as tr,useIdleEyeSaccades as nr,useMarkdown as rr,useVRMEmote as ir}from"./composables-D7YQJsZO.js";import{useQueue as ar}from"./queue-D6mkPVC_.js";import{EMOTION_EmotionMotionName_value as or,EMOTION_VRMExpressionName_value as sr,EmotionThinkMotionName as cr,llmInferenceEndToken as lr,useDelayMessageQueue as ur,useEmotionsMessageQueue as dr,useMessageContentQueue as fr}from"./queues-BZSFjE0u.js";var pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i;let ea,ta,na,ra;var ia=H({__name:`AudioSpectrum`,props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(e){let t=e,n=W(Array.from({length:t.bars}).fill(0));Yt(()=>{r()}),K(()=>t.stream,()=>{r()});function r(){if(!t.stream)return;let e=new(window.AudioContext||window.webkitAudioContext),r=e.createMediaStreamSource(t.stream),i=e.createAnalyser();i.fftSize=2048,r.connect(i);let a=i.frequencyBinCount,o=new Uint8Array(a),s=e.sampleRate,c=s/i.fftSize,l=Math.floor(t.minFreq/c),u=Math.floor(t.maxFreq/c),d=u-l,f=Math.floor(d/t.bars),p=()=>{try{requestAnimationFrame(p),i.getByteFrequencyData(o);let e=Array.from({length:t.bars}).fill(0);for(let n=0;nnn(e.$slots,`default`,{frequencies:n.value})}}),aa=ia;const oa={"h-full":``,flex:``,"items-center":``,"gap-1":``},sa=5;var ca=H({__name:`AudioSpectrumVisualizer`,props:{frequencies:null,barsClass:null},setup(e){let t=e;function n(e,t){let n=.1,r=1;return n+(r-n)*(e/t)}function r(e,r){let i=n(r,t.frequencies.length);return Math.min(100,Math.max(10,e*100*sa*i))}return(t,n)=>(U(),V(`div`,oa,[(U(!0),V(P,null,tn(e.frequencies,(t,n)=>(U(),V(`div`,{key:n,"h-full":``,flex:``,"flex-1":``,"items-end":``},[B(`div`,{transition:`all 100 ease-in-out`,"mx-auto":``,"my-0":``,"w-full":``,"rounded-full":``,class:Gt(e.barsClass),style:qt({height:`${r(t,n)}%`})},null,6)]))),128))]))}}),la=ca,ua=H({__name:`Volumed`,props:{perspective:null,transform:null},setup(e){return(t,n)=>(U(),V(`div`,{class:`volumed`,style:qt({perspective:`${e.perspective}px`,transform:e.transform})},[nn(t.$slots,`default`,{},void 0,!0)],4))}}),da=St(ua,[[`__scopeId`,`data-v-568551bc`]]),fa=H({__name:`CursorMomentum`,props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(e,{expose:t}){let n=e,r=W(1),i=W(0),a=0,o=fn(()=>n.friction),s=fn(()=>n.baseSpeed),c=fn(()=>n.momentumFactor);function l(e){a||=e;let t=e-a;a=e,r.value=s.value+(r.value-s.value)*o.value,i.value+=r.value*t,requestAnimationFrame(l)}function u(e){let t=Math.sqrt(e.movementX**2+e.movementY**2);r.value+=t*c.value}return Yt(()=>{window.addEventListener(`mousemove`,u),requestAnimationFrame(l)}),Zt(()=>{window.removeEventListener(`mousemove`,u)}),t({momentum:r,currentValue:i}),(e,t)=>nn(e.$slots,`default`,{momentum:r.value,currentValue:i.value})}}),pa=fa,ma=H({__name:`TestDummyMarkerFlat`,props:{size:null},setup(e){return(t,n)=>(U(),V(`div`,{class:`test-dummy-flat`,style:qt({width:`${e.size}px`,height:`${e.size}px`})},n[0]||=[B(`div`,{class:`marker`},null,-1)],4))}}),ha=St(ma,[[`__scopeId`,`data-v-b4ef37ac`]]),ga=H({__name:`TestDummyMarker`,setup(e){return(e,t)=>(U(),kt(pa,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:Nn(({currentValue:e})=>[Mt(da,{perspective:800,transform:`rotateX(45deg) translateY(3px)`},{default:Nn(()=>[Mt(ha,{size:24,style:qt({transform:`rotate(${e}deg)`})},null,8,[`style`])]),_:2},1024)]),_:1}))}}),_a=ga,va;(function(e){e[e.WEBGL_LEGACY=0]=`WEBGL_LEGACY`,e[e.WEBGL=1]=`WEBGL`,e[e.WEBGL2=2]=`WEBGL2`})(va||={});var ya;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.WEBGL=1]=`WEBGL`,e[e.CANVAS=2]=`CANVAS`})(ya||={});var ba;(function(e){e[e.COLOR=16384]=`COLOR`,e[e.DEPTH=256]=`DEPTH`,e[e.STENCIL=1024]=`STENCIL`})(ba||={});var xa;(function(e){e[e.NORMAL=0]=`NORMAL`,e[e.ADD=1]=`ADD`,e[e.MULTIPLY=2]=`MULTIPLY`,e[e.SCREEN=3]=`SCREEN`,e[e.OVERLAY=4]=`OVERLAY`,e[e.DARKEN=5]=`DARKEN`,e[e.LIGHTEN=6]=`LIGHTEN`,e[e.COLOR_DODGE=7]=`COLOR_DODGE`,e[e.COLOR_BURN=8]=`COLOR_BURN`,e[e.HARD_LIGHT=9]=`HARD_LIGHT`,e[e.SOFT_LIGHT=10]=`SOFT_LIGHT`,e[e.DIFFERENCE=11]=`DIFFERENCE`,e[e.EXCLUSION=12]=`EXCLUSION`,e[e.HUE=13]=`HUE`,e[e.SATURATION=14]=`SATURATION`,e[e.COLOR=15]=`COLOR`,e[e.LUMINOSITY=16]=`LUMINOSITY`,e[e.NORMAL_NPM=17]=`NORMAL_NPM`,e[e.ADD_NPM=18]=`ADD_NPM`,e[e.SCREEN_NPM=19]=`SCREEN_NPM`,e[e.NONE=20]=`NONE`,e[e.SRC_OVER=0]=`SRC_OVER`,e[e.SRC_IN=21]=`SRC_IN`,e[e.SRC_OUT=22]=`SRC_OUT`,e[e.SRC_ATOP=23]=`SRC_ATOP`,e[e.DST_OVER=24]=`DST_OVER`,e[e.DST_IN=25]=`DST_IN`,e[e.DST_OUT=26]=`DST_OUT`,e[e.DST_ATOP=27]=`DST_ATOP`,e[e.ERASE=26]=`ERASE`,e[e.SUBTRACT=28]=`SUBTRACT`,e[e.XOR=29]=`XOR`})(xa||={});var Sa;(function(e){e[e.POINTS=0]=`POINTS`,e[e.LINES=1]=`LINES`,e[e.LINE_LOOP=2]=`LINE_LOOP`,e[e.LINE_STRIP=3]=`LINE_STRIP`,e[e.TRIANGLES=4]=`TRIANGLES`,e[e.TRIANGLE_STRIP=5]=`TRIANGLE_STRIP`,e[e.TRIANGLE_FAN=6]=`TRIANGLE_FAN`})(Sa||={});var Ca;(function(e){e[e.RGBA=6408]=`RGBA`,e[e.RGB=6407]=`RGB`,e[e.RG=33319]=`RG`,e[e.RED=6403]=`RED`,e[e.RGBA_INTEGER=36249]=`RGBA_INTEGER`,e[e.RGB_INTEGER=36248]=`RGB_INTEGER`,e[e.RG_INTEGER=33320]=`RG_INTEGER`,e[e.RED_INTEGER=36244]=`RED_INTEGER`,e[e.ALPHA=6406]=`ALPHA`,e[e.LUMINANCE=6409]=`LUMINANCE`,e[e.LUMINANCE_ALPHA=6410]=`LUMINANCE_ALPHA`,e[e.DEPTH_COMPONENT=6402]=`DEPTH_COMPONENT`,e[e.DEPTH_STENCIL=34041]=`DEPTH_STENCIL`})(Ca||={});var wa;(function(e){e[e.TEXTURE_2D=3553]=`TEXTURE_2D`,e[e.TEXTURE_CUBE_MAP=34067]=`TEXTURE_CUBE_MAP`,e[e.TEXTURE_2D_ARRAY=35866]=`TEXTURE_2D_ARRAY`,e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=`TEXTURE_CUBE_MAP_POSITIVE_X`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=`TEXTURE_CUBE_MAP_NEGATIVE_X`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=`TEXTURE_CUBE_MAP_POSITIVE_Y`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=`TEXTURE_CUBE_MAP_NEGATIVE_Y`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=`TEXTURE_CUBE_MAP_POSITIVE_Z`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=`TEXTURE_CUBE_MAP_NEGATIVE_Z`})(wa||={});var Ta;(function(e){e[e.UNSIGNED_BYTE=5121]=`UNSIGNED_BYTE`,e[e.UNSIGNED_SHORT=5123]=`UNSIGNED_SHORT`,e[e.UNSIGNED_SHORT_5_6_5=33635]=`UNSIGNED_SHORT_5_6_5`,e[e.UNSIGNED_SHORT_4_4_4_4=32819]=`UNSIGNED_SHORT_4_4_4_4`,e[e.UNSIGNED_SHORT_5_5_5_1=32820]=`UNSIGNED_SHORT_5_5_5_1`,e[e.UNSIGNED_INT=5125]=`UNSIGNED_INT`,e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]=`UNSIGNED_INT_10F_11F_11F_REV`,e[e.UNSIGNED_INT_2_10_10_10_REV=33640]=`UNSIGNED_INT_2_10_10_10_REV`,e[e.UNSIGNED_INT_24_8=34042]=`UNSIGNED_INT_24_8`,e[e.UNSIGNED_INT_5_9_9_9_REV=35902]=`UNSIGNED_INT_5_9_9_9_REV`,e[e.BYTE=5120]=`BYTE`,e[e.SHORT=5122]=`SHORT`,e[e.INT=5124]=`INT`,e[e.FLOAT=5126]=`FLOAT`,e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=`FLOAT_32_UNSIGNED_INT_24_8_REV`,e[e.HALF_FLOAT=36193]=`HALF_FLOAT`})(Ta||={});var Ea;(function(e){e[e.FLOAT=0]=`FLOAT`,e[e.INT=1]=`INT`,e[e.UINT=2]=`UINT`})(Ea||={});var Da;(function(e){e[e.NEAREST=0]=`NEAREST`,e[e.LINEAR=1]=`LINEAR`})(Da||={});var Oa;(function(e){e[e.CLAMP=33071]=`CLAMP`,e[e.REPEAT=10497]=`REPEAT`,e[e.MIRRORED_REPEAT=33648]=`MIRRORED_REPEAT`})(Oa||={});var ka;(function(e){e[e.OFF=0]=`OFF`,e[e.POW2=1]=`POW2`,e[e.ON=2]=`ON`,e[e.ON_MANUAL=3]=`ON_MANUAL`})(ka||={});var Aa;(function(e){e[e.NPM=0]=`NPM`,e[e.UNPACK=1]=`UNPACK`,e[e.PMA=2]=`PMA`,e[e.NO_PREMULTIPLIED_ALPHA=0]=`NO_PREMULTIPLIED_ALPHA`,e[e.PREMULTIPLY_ON_UPLOAD=1]=`PREMULTIPLY_ON_UPLOAD`,e[e.PREMULTIPLY_ALPHA=2]=`PREMULTIPLY_ALPHA`,e[e.PREMULTIPLIED_ALPHA=2]=`PREMULTIPLIED_ALPHA`})(Aa||={});var ja;(function(e){e[e.NO=0]=`NO`,e[e.YES=1]=`YES`,e[e.AUTO=2]=`AUTO`,e[e.BLEND=0]=`BLEND`,e[e.CLEAR=1]=`CLEAR`,e[e.BLIT=2]=`BLIT`})(ja||={});var Ma;(function(e){e[e.AUTO=0]=`AUTO`,e[e.MANUAL=1]=`MANUAL`})(Ma||={});var Na;(function(e){e.LOW=`lowp`,e.MEDIUM=`mediump`,e.HIGH=`highp`})(Na||={});var Pa;(function(e){e[e.NONE=0]=`NONE`,e[e.SCISSOR=1]=`SCISSOR`,e[e.STENCIL=2]=`STENCIL`,e[e.SPRITE=3]=`SPRITE`,e[e.COLOR=4]=`COLOR`})(Pa||={});var Fa;(function(e){e[e.RED=1]=`RED`,e[e.GREEN=2]=`GREEN`,e[e.BLUE=4]=`BLUE`,e[e.ALPHA=8]=`ALPHA`})(Fa||={});var Ia;(function(e){e[e.NONE=0]=`NONE`,e[e.LOW=2]=`LOW`,e[e.MEDIUM=4]=`MEDIUM`,e[e.HIGH=8]=`HIGH`})(Ia||={});var La;(function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]=`ELEMENT_ARRAY_BUFFER`,e[e.ARRAY_BUFFER=34962]=`ARRAY_BUFFER`,e[e.UNIFORM_BUFFER=35345]=`UNIFORM_BUFFER`})(La||={});var Ra={createCanvas:function(e,t){var n=document.createElement(`canvas`);return n.width=e,n.height=t,n},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var e;return(e=document.baseURI)??window.location.href},fetch:function(e,t){return fetch(e,t)}},za=/iPhone/i,Ba=/iPod/i,Va=/iPad/i,Ha=/\biOS-universal(?:.+)Mac\b/i,Ua=/\bAndroid(?:.+)Mobile\b/i,Wa=/Android/i,Ga=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Ka=/Silk/i,qa=/Windows Phone/i,Ja=/\bWindows(?:.+)ARM\b/i,Ya=/BlackBerry/i,Xa=/BB10/i,Za=/Opera Mini/i,Qa=/\b(CriOS|Chrome)(?:.+)Mobile/i,$a=/Mobile(?:.+)Firefox\b/i,eo=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function to(e){return function(t){return t.test(e)}}function no(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=to(n),a={apple:{phone:i(za)&&!i(qa),ipod:i(Ba),tablet:!i(za)&&(i(Va)||eo(t))&&!i(qa),universal:i(Ha),device:(i(za)||i(Ba)||i(Va)||i(Ha)||eo(t))&&!i(qa)},amazon:{phone:i(Ga),tablet:!i(Ga)&&i(Ka),device:i(Ga)||i(Ka)},android:{phone:!i(qa)&&i(Ga)||!i(qa)&&i(Ua),tablet:!i(qa)&&!i(Ga)&&!i(Ua)&&(i(Ka)||i(Wa)),device:!i(qa)&&(i(Ga)||i(Ka)||i(Ua)||i(Wa))||i(/\bokhttp\b/i)},windows:{phone:i(qa),tablet:i(Ja),device:i(qa)||i(Ja)},other:{blackberry:i(Ya),blackberry10:i(Xa),opera:i(Za),firefox:i($a),chrome:i(Qa),device:i(Ya)||i(Xa)||i(Za)||i($a)||i(Qa)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var ro=no(globalThis.navigator);function io(){return!ro.apple.device}function ao(e){var t=!0;if(ro.tablet||ro.phone){if(ro.apple.device){var n=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(n){var r=parseInt(n[1],10);r<11&&(t=!1)}}if(ro.android.device){var n=navigator.userAgent.match(/Android\s([0-9.]*)/);if(n){var r=parseInt(n[1],10);r<7&&(t=!1)}}}return t?e:4}var oo={ADAPTER:Ra,MIPMAP_TEXTURES:ka.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:Ia.NONE,SPRITE_MAX_TEXTURES:ao(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:Ma.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Oa.CLAMP,SCALE_MODE:Da.LINEAR,PRECISION_VERTEX:Na.HIGH,PRECISION_FRAGMENT:ro.apple.device?Na.HIGH:Na.MEDIUM,CAN_UPLOAD_SAME_BUFFER:io(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},so=bt((exports,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{t.exports=n,t.exports.default=n;function n(e,t,n){n||=2;var i=t&&t.length,o=i?t[0]*n:e.length,s=r(e,0,o,n,!0),c=[];if(!s||s.next===s.prev)return c;var l,d,f,p,m,h,g;if(i&&(s=u(e,t,s,n)),e.length>80*n){l=f=e[0],d=p=e[1];for(var _=n;_f&&(f=m),h>p&&(p=h);g=Math.max(f-l,p-d),g=g===0?0:32767/g}return a(s,c,n,l,d,g,0),c}function r(e,t,n,r,i){var a,o;if(i===N(e,t,n,r)>0)for(a=t;a=t;a-=r)o=A(a,e[a],e[a+1],o);return o&&S(o,o.next)&&(j(o),o=o.next),o}function i(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(S(n,n.next)||x(n.prev,n,n.next)===0)){if(j(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function a(e,t,n,r,u,d,f){if(e){!f&&d&&h(e,r,u,d);for(var p=e,m,g;e.prev!==e.next;){if(m=e.prev,g=e.next,d?s(e,r,u,d):o(e)){t.push(m.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),j(e),e=g.next,p=g.next;continue}if(e=g,e===p){f?f===1?(e=c(i(e),t,n),a(e,t,n,r,u,d,2)):f===2&&l(e,t,n,r,u,d):a(i(e),t,n,r,u,d,1);break}}}}function o(e){var t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=ia?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&y(i,s,a,c,o,l,m.x,m.y)&&x(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,r){var i=e.prev,a=e,o=e.next;if(x(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=sc?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,v=_(p,m,t,n,r),b=_(h,g,t,n,r),S=e.prevZ,C=e.nextZ;S&&S.z>=v&&C&&C.z<=b;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0||(S=S.prevZ,C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;S&&S.z>=v;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;C&&C.z<=b;){if(C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!S(a,o)&&C(a,r,r.next,o)&&D(a,o)&&D(o,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),j(r),j(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,r,o,s){var c=e;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&b(c,l)){var u=k(c,l);c=i(c,c.next),u=i(u,u.next),a(c,t,n,r,o,s,0),a(u,t,n,r,o,s,0);return}l=l.next}c=c.next}while(c!==e)}function u(e,t,n,i){var a=[],o,s,c,l,u;for(o=0,s=t.length;o=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x=n.x&&n.x>=l&&r!==n.x&&y(io.x||n.x===o.x&&m(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function m(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function h(e,t,n,r){var i=e;do i.z===0&&(i.z=_(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function _(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function v(e){var t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function b(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&(D(e,t)&&D(t,e)&&O(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||S(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,n,r){var i=T(x(e,t,n)),a=T(x(e,t,r)),o=T(x(n,r,e)),s=T(x(n,r,t));return!!(i!==a&&o!==s||i===0&&w(e,n,t)||a===0&&w(e,r,t)||o===0&&w(n,e,r)||s===0&&w(n,t,r))}function w(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&C(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function D(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function k(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function A(e,t,n,r){var i=new M(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(N(e,0,a,n));if(i)for(var s=0,c=t.length;s0&&(r+=e[i-1].length,n.holes.push(r))}return n}}),lo=bt((exports,t)=>{(function(n){var r=typeof exports==`object`&&exports&&!exports.nodeType&&exports,i=typeof t==`object`&&t&&!t.nodeType&&t,a=typeof global==`object`&&global;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,c=36,l=1,u=26,d=38,f=700,p=72,m=128,h=`-`,g=/^xn--/,_=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},b=c-l,x=Math.floor,S=String.fromCharCode,C;function w(e){throw RangeError(y[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(v,`.`);var i=e.split(`.`),a=T(i,t).join(`.`);return r+a}function D(e){for(var t=[],n=0,r=e.length,i,a;n=55296&&i<=56319&&n65535&&(e-=65536,t+=S(e>>>10&1023|55296),e=56320|e&1023),t+=S(e),t}).join(``)}function k(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function A(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function j(e,t,n){var r=0;for(e=n?x(e/f):e>>1,e+=x(e/t);e>b*u>>1;r+=c)e=x(e/b);return x(r+(b+1)*e/(e+d))}function M(e){var t=[],n=e.length,r,i=0,a=m,o=p,d,f,g,_,v,y,b,S,C;for(d=e.lastIndexOf(h),d<0&&(d=0),f=0;f=128&&w(`not-basic`),t.push(e.charCodeAt(f));for(g=d>0?d+1:0;g=n&&w(`invalid-input`),b=k(e.charCodeAt(g++)),(b>=c||b>x((s-i)/v))&&w(`overflow`),i+=b*v,S=y<=o?l:y>=o+u?u:y-o,!(bx(s/C)&&w(`overflow`),v*=C;r=t.length+1,o=j(i-_,r,_==0),x(i/r)>s-a&&w(`overflow`),a+=x(i/r),i%=r,t.splice(i++,0,a)}return O(t)}function N(e){var t,n,r,i,a,o,d,f,g,_,v,y=[],b,C,T,E;for(e=D(e),b=e.length,t=m,n=0,a=p,o=0;o=t&&vx((s-n)/C)&&w(`overflow`),n+=(d-t)*C,t=d,o=0;os&&w(`overflow`),v==t){for(f=n,g=c;_=g<=a?l:g>=a+u?u:g-a,!(f<_);g+=c)E=f-_,T=c-_,y.push(S(A(_+E%T,0))),f=x(E/T);y.push(S(A(f,0))),a=j(n,C,r==i),n=0,++r}++n,++t}return y.join(``)}function ee(e){return E(e,function(e){return g.test(e)?M(e.slice(4).toLowerCase()):e})}function P(e){return E(e,function(e){return _.test(e)?`xn--`+N(e):e})}if(o={version:`1.4.1`,ucs2:{decode:D,encode:O},decode:M,encode:N,toASCII:P,toUnicode:ee},typeof define==`function`&&typeof define.amd==`object`&&define.amd)define(`punycode`,function(){return o});else if(r&&i)if(t.exports==r)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(r[C]=o[C]);else n.punycode=o})(void 0)}),uo=bt((exports,t)=>{Object.defineProperty(exports,`__esModule`,{value:!0});function n(){let e,t,n=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.get(n)}else if(t)return t.get(n)},r=(n,r)=>{n&&(typeof n==`object`||typeof n==`function`)?(e||=new WeakMap,e.set(n,r)):(t||=new Map,t.set(n,r))},i=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.has(n)}else if(t)return t.has(n);return!1},a=e=>{if(!i(e))throw TypeError(`Side channel does not contain the given key`)};return{get:n,set:r,has:i,assert:a}}exports.default=n,(typeof exports.default==`object`&&exports.default!==null||typeof exports.default==`function`)&&(Object.assign(exports.default,exports),t.exports=exports.default)}),fo=bt((exports,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:`RFC1738`,RFC3986:`RFC3986`};t.exports={default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,r,`+`)},RFC3986:function(e){return String(e)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}}),po=bt((exports,t)=>{var n=fo(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e}(),o=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],a=0;a=d?s.slice(l,l+d):s,f=[],p=0;p=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||o===n.RFC1738&&(m===40||m===41)){f[f.length]=u.charAt(p);continue}if(m<128){f[f.length]=a[m];continue}if(m<2048){f[f.length]=a[192|m>>6]+a[128|m&63];continue}if(m<55296||m>=57344){f[f.length]=a[224|m>>12]+a[128|m>>6&63]+a[128|m&63];continue}p+=1,m=65536+((m&1023)<<10|u.charCodeAt(p)&1023),f[f.length]=a[240|m>>18]+a[128|m>>12&63]+a[128|m>>6&63]+a[128|m&63]}c+=f.join(``)}return c},p=function(e){for(var t=[{obj:{o:e},prop:`o`}],n=[],r=0;r{var n=uo(),r=po(),i=fo(),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,commaRoundTrip:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},m={},h=function e(t,i,a,o,c,u,d,h,g,_,v,y,b,x,S,C,w,T){for(var E=t,D=T,O=0,k=!1;(D=D.get(m))!==void 0&&!k;){var A=D.get(t);if(O+=1,A!==void 0){if(A===O)throw RangeError(`Cyclic object value`);k=!0}D.get(m)===void 0&&(O=0)}if(typeof _==`function`?E=_(i,E):E instanceof Date?E=b(E):a===`comma`&&s(E)&&(E=r.maybeMap(E,function(e){return e instanceof Date?b(e):e})),E===null){if(u)return g&&!C?g(i,f.encoder,w,`key`,x):i;E=``}if(p(E)||r.isBuffer(E)){if(g){var j=C?i:g(i,f.encoder,w,`key`,x);return[S(j)+`=`+S(g(E,f.encoder,w,`value`,x))]}return[S(i)+`=`+S(String(E))]}var M=[];if(E===void 0)return M;var N;if(a===`comma`&&s(E))C&&g&&(E=r.maybeMap(E,g)),N=[{value:E.length>0?E.join(`,`)||null:void 0}];else if(s(_))N=_;else{var ee=Object.keys(E);N=v?ee.sort(v):ee}var P=h?String(i).replace(/\./g,`%2E`):String(i),F=o&&s(E)&&E.length===1?P+`[]`:P;if(c&&s(E)&&E.length===0)return F+`[]`;for(var I=0;I0?b+y:``}}),ho=bt((exports,t)=>{var n=po(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1)return e.split(`,`);if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);return e},c=`utf8=%26%2310003%3B`,l=`utf8=%E2%9C%93`,u=function(e,t){var u={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,``):e;d=d.replace(/%5B/gi,`[`).replace(/%5D/gi,`]`);var f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,t.throwOnLimitExceeded?f+1:f);if(t.throwOnLimitExceeded&&p.length>f)throw RangeError(`Parameter limit exceeded. Only `+f+` parameter`+(f===1?``:`s`)+` allowed.`);var m=-1,h,g=t.charset;if(t.charsetSentinel)for(h=0;h-1&&(x=i(x)?[x]:x);var S=r.call(u,b);S&&t.duplicates===`combine`?u[b]=n.combine(u[b],x):(!S||t.duplicates===`last`)&&(u[b]=x)}return u},d=function(e,t,r,i){var a=0;if(e.length>0&&e[e.length-1]===`[]`){var o=e.slice(0,-1).join(``);a=Array.isArray(t)&&t[o]?t[o].length:0}for(var c=i?t:s(t,r,a),l=e.length-1;l>=0;--l){var u,d=e[l];if(d===`[]`&&r.parseArrays)u=r.allowEmptyArrays&&(c===``||r.strictNullHandling&&c===null)?[]:n.combine([],c);else{u=r.plainObjects?{__proto__:null}:{};var f=d.charAt(0)===`[`&&d.charAt(d.length-1)===`]`?d.slice(1,-1):d,p=r.decodeDotInKeys?f.replace(/%2E/g,`.`):f,m=parseInt(p,10);!r.parseArrays&&p===``?u={0:c}:!isNaN(m)&&d!==p&&String(m)===p&&m>=0&&r.parseArrays&&m<=r.arrayLimit?(u=[],u[m]=c):p!==`__proto__`&&(u[p]=c)}c=u}return c},f=function(e,t,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(a),l=c?a.slice(0,c.index):a,u=[];if(l){if(!n.plainObjects&&r.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var f=0;n.depth>0&&(c=s.exec(a))!==null&&f{var n=mo(),r=ho(),i=fo();t.exports={formats:i,parse:r,stringify:n}}),_o=bt(exports=>{var t=lo();function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=[`<`,`>`,`"`,"`",` `,`\r`,` `,` `],s=[`{`,`}`,`|`,`\\`,`^`,"`"].concat(o),c=[`'`].concat(s),l=[`%`,`/`,`?`,`;`,`#`].concat(c),u=[`/`,`?`,`#`],d=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=go();function v(e,t,r){if(e&&typeof e==`object`&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}n.prototype.parse=function(e,n,i){if(typeof e!=`string`)throw TypeError(`Parameter 'url' must be a string, not `+typeof e);var o=e.indexOf(`?`),s=o!==-1&&o127?ee+=`x`:ee+=N[P];if(!ee.match(f)){var I=j.slice(0,E),te=j.slice(E+1),ne=N.match(p);ne&&(I.push(ne[1]),te.unshift(ne[2])),te.length&&(b=`/`+te.join(`.`)+b),this.hostname=I.join(`.`);break}}}this.hostname.length>d?this.hostname=``:this.hostname=this.hostname.toLowerCase(),A||(this.hostname=t.toASCII(this.hostname));var L=this.port?`:`+this.port:``,re=this.hostname||``;this.host=re+L,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),b[0]!==`/`&&(b=`/`+b))}if(!m[C])for(var E=0,M=c.length;E0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return r.search=e.search,r.query=e.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path=`/`+r.search:r.path=null,r.href=r.format(),r;for(var T=S.slice(-1)[0],E=(r.host||e.host||S.length>1)&&(T===`.`||T===`..`)||T===``,D=0,O=S.length;O>=0;O--)T=S[O],T===`.`?S.splice(O,1):T===`..`?(S.splice(O,1),D++):D&&(S.splice(O,1),D--);if(!b&&!x)for(;D--;)S.unshift(`..`);b&&S[0]!==``&&(!S[0]||S[0].charAt(0)!==`/`)&&S.unshift(``),E&&S.join(`/`).substr(-1)!==`/`&&S.push(``);var k=S[0]===``||S[0]&&S[0].charAt(0)===`/`;if(C){r.hostname=k?``:S.length?S.shift():``,r.host=r.hostname;var w=r.host&&r.host.indexOf(`@`)>0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return b||=r.host&&S.length,b&&!k&&S.unshift(``),S.length>0?r.pathname=S.join(`/`):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},exports.parse=v,exports.resolve=b,exports.resolveObject=x,exports.format=y,exports.Url=n}),vo=Tt(so(),1),yo=Tt(co(),1),bo=Tt(_o(),1),xo={parse:bo.parse,format:bo.format,resolve:bo.resolve};oo.RETINA_PREFIX=/@([0-9\.]+)x/,oo.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var So=!1,Co=`6.5.10`;function wo(e){var t;if(!So){if(oo.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf(`chrome`)>-1){var n=[` %c %c %c PixiJS `+Co+` - ✰ `+e+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ @@ -3763,11 +3763,11 @@ float PCSS (sampler2D shadowMap, vec4 coords) { }`,r=Ye.shadowmap_pars_fragment,{renderer:i,scene:a,camera:o}=cn();function s(e,t){let i=r;i=i.replace(`#ifdef USE_SHADOWMAP`,`#ifdef USE_SHADOWMAP ${n(t)}`),i=i.replace(`#if defined( SHADOWMAP_TYPE_PCF )`,`${bA} #if defined( SHADOWMAP_TYPE_PCF )`),Ye.shadowmap_pars_fragment=i,e.shadowMap.enabled=!0}function c(e,t,n){t.traverse(t=>{var n,r;`material`in t&&t.material&&(e.properties.remove(t.material),typeof t.material==`object`&&`dispose`in t.material&&typeof t.material.dispose==`function`&&((r=(n=t.material).dispose)==null||r.call(n)))}),e.info.programs&&(e.info.programs.length=0),e.compile(t,n)}return Zt(()=>{o.value&&(Ye.shadowmap_pars_fragment=r,c(i.value,a.value,o.value))}),K(t,()=>{o.value&&(s(i.value,t),c(i.value,a.value,o.value))},{immediate:!0}),(e,t)=>(U(),V(`TresGroup`))}});var SA=class extends Ae{constructor(){super(),Sb(this,`virtualScene`,null),this.virtualScene=new Je}add(...e){return this.virtualScene.add(...e),this}dispose(){this.virtualScene.traverse(e=>{e instanceof be&&(e.geometry.dispose(),e.material.dispose(),e.material.map&&e.material.map.dispose(),this.virtualScene.remove(e))}),this.virtualScene=null}};const CA=H({__name:`component`,props:{background:{type:[Boolean,String],default:!1},blur:{default:0},files:{default:()=>[]},path:{default:``},preset:{default:void 0},resolution:{default:256},near:{default:1},far:{default:1e3},frames:{default:1/0},backgroundIntensity:{default:1},backgroundRotation:{},environmentIntensity:{default:1},environmentRotation:{},syncMaterials:{type:Boolean}},async setup(e,{expose:t}){let n,r,i=e,a=W(null);t({texture:a});let{extend:o,renderer:c,scene:l}=Qt();o({EnvironmentScene:SA});let d=null,f=W(null),p=null,m=W(null),h=([n,r]=Mn(()=>RT(i,f)),n=await n,r(),n),{onBeforeRender:g}=zt(),v=1;g(()=>{if(p&&m.value&&f.value&&(i.frames===1/0||v{if(e&&t!=null&&t.virtualScene){let n=dn(t).virtualScene,r=n.children.find(e=>e instanceof be&&e.userData.isEnvironment);r||(r=new be(new u(1,1,1),new xe({side:s})),r.userData.isEnvironment=!0,n.add(r)),n.background=e,n.backgroundBlurriness=i.blur}},{immediate:!0});let y=e=>{e&&d!=null&&d.length?(l.value.environment=e.texture,i.background&&(l.value.background=e.texture)):h.value&&(l.value.environment=h.value,i.background&&(l.value.background=h.value))};return K(h,()=>{f.value&&y(f.value)},{immediate:!0,deep:!0}),K(()=>wn().default,e=>{var t;if(e&&(d=e(),Array.isArray(d)&&d.length>0)){o({EnvironmentScene:SA}),f.value=new gt(i.resolution),f.value.texture.type=te,p=new _(i.near,i.far,f.value),y(f.value);return}(t=f.value)==null||t.dispose(),f.value=null,y()},{immediate:!0,deep:!0}),a.value=h.value,Zt(()=>{var e,t;(e=m.value)==null||e.dispose(),(t=f.value)==null||t.dispose()}),(e,t)=>f.value?(U(),V(`TresEnvironmentScene`,{key:0,ref_key:`environmentScene`,ref:m},[nn(e.$slots,`default`)],512)):At(``,!0)}}),wA={key:0,args:[0,1,64]},TA={key:1,args:[.5,1,64]},EA={key:2},DA=[`tone-mapped`,`map`,`side`,`color`],OA=H({__name:`index`,props:{args:{default:null},form:{default:`rect`},toneMapped:{type:Boolean,default:!1},map:{default:null},intensity:{default:1},color:{default:new h(16777215)}},setup(e,{expose:t}){let n=e,r=W(),i=W();return jn(()=>{r.value&&(r.value.color.copy(new h(n.color)),r.value.color.multiplyScalar(n.intensity),r.value.needsUpdate=!0)}),t({mesh:i}),(e,t)=>(U(),V(`TresMesh`,{ref_key:`mesh`,ref:i},[e.form===`circle`?(U(),V(`TresRingGeometry`,wA)):e.form===`ring`?(U(),V(`TresRingGeometry`,TA)):e.form===`rect`?(U(),V(`TresPlaneGeometry`,EA)):(U(),kt(n.form,{key:3,args:e.args},null,8,[`args`])),B(`TresMeshBasicMaterial`,{ref_key:`material`,ref:r,"tone-mapped":e.toneMapped,map:e.map,side:G(T),color:e.color},null,8,DA)],512))}});var kA=H({__name:`Range`,props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`mousedown`],setup(e,{emit:t}){let n=e,r=t,i=W(null);function a(e,t,n){return Math.min(Math.max(e,t),n)}function o(e){let t=e.toString();if(t.includes(`e-`))return Number.parseInt(t.split(`e-`)[1],10);let n=t.includes(`.`)?t.split(`.`)[1].length:0;return n}function s(e,t){let n=o(t),r=10**(n+3);return Number.parseFloat((e*r/r).toFixed(n))}let c=Ot(()=>s(a(n.modelValue,n.min,n.max),n.step)),l=Ot(()=>{let e=(c.value-n.min)/(n.max-n.min)*100;return{width:`${e}%`,backgroundSize:`${e}% 100%`}});function u(e){if(!i.value)return c.value;let t=i.value.getBoundingClientRect(),r=e.clientX-t.left,a=r/t.width,o=n.max-n.min,s=n.min+o*a,l=Math.round(s/n.step)*n.step;return Math.min(Math.max(l,n.min),n.max)}function d(e){if(n.disabled)return;let t=u(e);r(`update:modelValue`,t)}function f(e){if(n.disabled)return;e.preventDefault();let t=u(e);r(`update:modelValue`,t),window.addEventListener(`mousemove`,d),window.addEventListener(`mouseup`,p)}function p(e){window.removeEventListener(`mousemove`,d),window.removeEventListener(`mouseup`,p)}return Zt(()=>{window.removeEventListener(`mousemove`,d),window.removeEventListener(`mouseup`,p)}),(t,n)=>(U(),V(`span`,{ref_key:`sliderRef`,ref:i,class:Gt([`range-slider disabled:pointer-events-none disabled:cursor-default disabled:opacity-50`,{disabled:e.disabled}]),bg:`[#e6e1fc] dark:[#676085]`,"touch-action-none":``,relative:``,"inline-block":``,"w-full":``,"cursor-ew-resize":``,"rounded-sm":``,onMousedown:f},[B(`span`,{style:qt(l.value),bg:`[#cabeff] dark:[#4e34b9]`,relative:``,block:``,"rounded-sm":``,h:`[14px]`},null,4),B(`span`,{role:`slider`,class:`slider-thumb`,style:qt({left:`${(c.value-e.min)/(e.max-e.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))}}),AA=kA,jA=H({__name:`Model`,props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:[`loadModelProgress`,`error`],setup(e,{expose:t,emit:n}){let i=e,a=n,o,s=W(),c=W(),{scene:l}=Qt(),{onBeforeRender:u}=zt(),d=tr(),f=nr(),p=W();K(()=>i.position,([e,t,n])=>{s.value&&s.value.scene.position.set(e,t,n)}),Yt(async()=>{if(l.value)try{let e=await Qn(i.model,{scene:l.value,lookAt:!0,position:i.position,onProgress:e=>a(`loadModelProgress`,Number.parseFloat((100*(e.loaded/e.total)).toFixed(2)))});if(!e){console.warn(`No VRM model loaded`);return}let t=await Zn(i.idleAnimation),n=await Yn(e,t);if(!n){console.warn(`No VRM animation loaded`);return}c.value=new r(e.scene),c.value.clipAction(n).play(),p.value=ir(e),s.value=e,o=u(({delta:e})=>{var t,n,r;(t=c.value)?.update(e),(n=s.value)?.update(e),d.update(s.value,e),f.update(s.value,e),(r=p.value)?.update(e)}).off}catch(e){a(`error`,e)}}),Zt(()=>{o?.(),s.value&&(s.value.scene.removeFromParent(),Jn.deepDispose(s.value.scene))}),t({setExpression(e){var t;(t=p.value)?.setEmotionWithResetAfter(e,1e3)}});let{pause:m,resume:h}=zt();return K(()=>i.paused,e=>{e?m():h()}),(e,t)=>nn(e.$slots,`default`)}}),MA=jA;const NA=[`position`],PA={absolute:``,bottom:`3`,right:`3`},FA={flex:`~ row`,"cursor-pointer":``},IA=[`checked`,`aria-checked`],LA={key:0,"min-w":`50vw`,z:`{var t;(t=f.value)?.setExpression(e)}}),(e,t)=>(U(),kt(rb,{relative:``},{default:Nn(({height:e,width:n})=>[Mt(G(ht),{alpha:!0,antialias:!0,width:n,height:e},{default:Nn(()=>[Mt(G(HE)),B(`TresPerspectiveCamera`,{position:[o.value,s.value,c.value]},null,8,NA),t[14]||=B(`TresDirectionalLight`,{color:16777215,intensity:1.2,position:[1,1,1]},null,-1),t[15]||=B(`TresAmbientLight`,{color:16777215,intensity:1.5},null,-1),Mt(MA,{ref_key:`modelRef`,ref:f,model:r.model,"idle-animation":r.idleAnimation,position:[l.value,u.value,d.value],paused:r.paused,onLoadModelProgress:t[0]||=e=>i(`loadModelProgress`,e),onError:t[1]||=e=>i(`error`,e)},null,8,[`model`,`idle-animation`,`position`,`paused`])]),_:2,__:[14,15]},1032,[`width`,`height`]),B(`div`,PA,[B(`div`,FA,[B(`label`,{class:Gt([a.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":``},[Pn(B(`input`,{"onUpdate:modelValue":t[2]||=e=>a.value=e,checked:a.value,"aria-checked":a.value,name:`showLive2DViewerInspector`,type:`checkbox`,"appearance-none":``,"outline-none":``,hidden:``},null,8,IA),[[En,a.value]]),t[16]||=B(`div`,{"select-none":``},[B(`div`,{"i-solar:bug-bold-duotone":``})],-1)],2)]),Mt(G(Wn),null,{default:Nn(()=>[a.value?(U(),V(`div`,LA,[B(`div`,RA,[B(`div`,zA,[B(`span`,null,un(G(p)(`stage.viewers.debug-menu.vrm.model.title`)),1)]),Mt(Un,{"h-fit":``,"w-full":``,flex:`~ col`,border:`~ gray/25 rounded-lg`,divide:`y dashed gray/25`,"of-clip":``,"shadow-sm":``},{label:Nn(()=>[B(`span`,BA,un(G(p)(`stage.viewers.debug-menu.vrm.camera`)),1)]),default:Nn(()=>[B(`div`,VA,[t[17]||=B(`div`,{text:`neutral-400 dark:neutral-500`},[B(`span`,null,`X`)],-1),B(`label`,HA,[Mt(AA,{modelValue:o.value,"onUpdate:modelValue":t[3]||=e=>o.value=e,min:-10,max:10,step:.01},null,8,[`modelValue`])]),B(`div`,UA,[B(`span`,null,un(o.value),1)]),t[18]||=B(`div`,{text:`neutral-400 dark:neutral-500`},[B(`span`,null,`Y`)],-1),B(`label`,WA,[Mt(AA,{modelValue:s.value,"onUpdate:modelValue":t[4]||=e=>s.value=e,min:-10,max:10,step:.01},null,8,[`modelValue`])]),B(`div`,GA,[B(`span`,null,un(s.value),1)]),t[19]||=B(`div`,{text:`neutral-400 dark:neutral-500`},[B(`span`,null,`Z`)],-1),B(`label`,KA,[Mt(AA,{modelValue:c.value,"onUpdate:modelValue":t[5]||=e=>c.value=e,min:-10,max:10,step:.01},null,8,[`modelValue`])]),B(`div`,qA,[B(`span`,null,un(c.value),1)])])]),_:1}),Mt(Un,{"h-fit":``,"w-full":``,flex:`~ col`,border:`~ gray/25 rounded-lg`,divide:`y dashed gray/25`,"of-clip":``,"shadow-sm":``},{label:Nn(()=>[B(`span`,JA,un(G(p)(`stage.viewers.debug-menu.vrm.model.title`)),1)]),default:Nn(()=>[B(`div`,YA,[t[20]||=B(`div`,{text:`neutral-400 dark:neutral-500`},[B(`span`,null,`X`)],-1),B(`label`,XA,[Mt(AA,{modelValue:l.value,"onUpdate:modelValue":t[6]||=e=>l.value=e,min:-10,max:10,step:.01},null,8,[`modelValue`])]),B(`div`,ZA,[B(`span`,null,un(l.value),1)]),t[21]||=B(`div`,{text:`neutral-400 dark:neutral-500`},[B(`span`,null,`Y`)],-1),B(`label`,QA,[Mt(AA,{modelValue:u.value,"onUpdate:modelValue":t[7]||=e=>u.value=e,min:-10,max:10,step:.01},null,8,[`modelValue`])]),B(`div`,$A,[B(`span`,null,un(u.value),1)]),t[22]||=B(`div`,{text:`neutral-400 dark:neutral-500`},[B(`span`,null,`Z`)],-1),B(`label`,ej,[Mt(AA,{modelValue:d.value,"onUpdate:modelValue":t[8]||=e=>d.value=e,min:-10,max:10,step:.01},null,8,[`modelValue`])]),B(`div`,tj,[B(`span`,null,un(d.value),1)])])]),_:1}),B(`div`,nj,[B(`span`,null,un(G(p)(`stage.viewers.debug-menu.emotions`)),1)]),B(`div`,rj,[B(`button`,{"rounded-lg":``,bg:`neutral-100/70 dark:neutral-800/50`,"px-2":``,"py-1":``,"backdrop-blur-sm":``,onClick:t[9]||=e=>{var t;return(t=f.value)?.setExpression(`neutral`)}},un(G(p)(`stage.viewers.debug-menu.emotions-btn.neutral`)),1),B(`button`,{"rounded-lg":``,bg:`neutral-100/70 dark:neutral-800/50`,"px-2":``,"py-1":``,"backdrop-blur-sm":``,onClick:t[10]||=e=>{var t;return(t=f.value)?.setExpression(`surprised`)}},un(G(p)(`stage.viewers.debug-menu.emotions-btn.surprised`)),1),B(`button`,{"rounded-lg":``,bg:`neutral-100/70 dark:neutral-800/50`,"px-2":``,"py-1":``,"backdrop-blur-sm":``,onClick:t[11]||=e=>{var t;return(t=f.value)?.setExpression(`sad`)}},un(G(p)(`stage.viewers.debug-menu.emotions-btn.sad`)),1),B(`button`,{"rounded-lg":``,bg:`neutral-100/70 dark:neutral-800/50`,"px-2":``,"py-1":``,"backdrop-blur-sm":``,onClick:t[12]||=e=>{var t;return(t=f.value)?.setExpression(`angry`)}},un(G(p)(`stage.viewers.debug-menu.emotions-btn.angry`)),1),B(`button`,{"rounded-lg":``,bg:`neutral-100/70 dark:neutral-800/50`,"px-2":``,"py-1":``,"backdrop-blur-sm":``,onClick:t[13]||=e=>{var t;return(t=f.value)?.setExpression(`happy`)}},un(G(p)(`stage.viewers.debug-menu.emotions-btn.happy`)),1)])])])):At(``,!0)]),_:1})])]),_:1}))}}),aj=ij;const oj=[`onClick`],sj={flex:``,"gap-1.5":``};var cj=H({__name:`Section`,props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(e){return(t,n)=>(U(),kt(Un,{default:e.expand},{trigger:Nn(t=>[B(`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:e=>t.setVisible(!t.visible)},[B(`div`,sj,[B(`div`,{class:Gt(e.icon),"size-6":``},null,2),jt(` `+un(e.title),1)]),B(`div`,{"i-solar:alt-arrow-down-bold-duotone":``,transition:`transform duration-250`,class:Gt({"rotate-180":t.visible})},null,2)],8,oj)]),default:Nn(()=>[B(`div`,{grid:``,"gap-2":``,"p-4":``,class:Gt(e.innerClass)},[nn(t.$slots,`default`)],2)]),_:3},8,[`default`]))}}),lj=cj;function uj(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function dj(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function fj(e){return this instanceof fj?(this.v=e,this):new fj(e)}function pj(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof fj?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function mj(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:fj(e[r](t)),done:!1}:i?i(t):t}:i}}function hj(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof dj==`function`?dj(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}const gj=new TextDecoder(`utf-8`),_j=e=>gj.decode(e),vj=new TextEncoder,yj=e=>vj.encode(e),bj=e=>typeof e==`number`,xj=e=>typeof e==`boolean`,Sj=e=>typeof e==`function`,Cj=e=>e!=null&&Object(e)===e,wj=e=>Cj(e)&&Sj(e.then),Tj=e=>Cj(e)&&Sj(e[Symbol.iterator]),Ej=e=>Cj(e)&&Sj(e[Symbol.asyncIterator]),Dj=e=>Cj(e)&&Cj(e.schema),Oj=e=>Cj(e)&&`done`in e&&`value`in e,kj=e=>Cj(e)&&Sj(e.stat)&&bj(e.fd),Aj=e=>Cj(e)&&Nj(e.body),jj=e=>`_getDOMStream`in e&&`_getNodeStream`in e,Mj=e=>Cj(e)&&Sj(e.abort)&&Sj(e.getWriter)&&!jj(e),Nj=e=>Cj(e)&&Sj(e.cancel)&&Sj(e.getReader)&&!jj(e),Pj=e=>Cj(e)&&Sj(e.end)&&Sj(e.write)&&xj(e.writable)&&!jj(e),Fj=e=>Cj(e)&&Sj(e.read)&&Sj(e.pipe)&&xj(e.readable)&&!jj(e),Ij=e=>Cj(e)&&Sj(e.clear)&&Sj(e.bytes)&&Sj(e.position)&&Sj(e.setPosition)&&Sj(e.capacity)&&Sj(e.getBufferIdentifier)&&Sj(e.createLong),Lj=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function Rj(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++cVj(Int32Array,e),Uj=e=>Vj(BigInt64Array,e),Wj=e=>Vj(Uint8Array,e),Gj=e=>(e.next(),e);function*Kj(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Lj?n(t):Tj(t)?t:n(t);return yield*Gj(function*(t){let n=null;do n=t.next(yield Vj(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const qj=e=>Kj(Uint8Array,e);function Jj(e,t){return pj(this,arguments,function*(){if(wj(t))return yield fj(yield fj(yield*mj(hj(Jj(e,yield fj(t))))));let n=function(e){return pj(this,arguments,function*(){yield yield fj(yield fj(e))})},r=function(e){return pj(this,arguments,function*(){yield fj(yield*mj(hj(Gj(function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)}(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Lj?n(t):Tj(t)?r(t):Ej(t)?t:n(t);return yield fj(yield*mj(hj(Gj(function(t){return pj(this,arguments,function*(){let n=null;do n=yield fj(t.next(yield yield fj(Vj(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield fj(new e)})}const Yj=e=>Jj(Uint8Array,e);function Xj(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++n(e.next(),e);function*eM(e){let t,n=!1,r=[],i,a,o,s=0;function c(){return a===`peek`?Bj(r,o)[0]:([i,r,s]=Bj(r,o),i)}({cmd:a,size:o}=(yield(()=>null)())||{cmd:`read`,size:0});let l=qj(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?l.next():l.next(o-s),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield c());while(onull)()))||{cmd:`read`,size:0});let l=Yj(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?yield fj(l.next()):yield fj(l.next(o-s)),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield fj(c()));while(onull)()))||{cmd:`read`,size:0});let l=new rM(e);try{do if({done:t,value:i}=Number.isNaN(o-s)?yield fj(l.read()):yield fj(l.read(o-s)),!t&&i.byteLength>0&&(r.push(Wj(i)),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield fj(c()));while(o{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return uj(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return uj(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array};let t=yield this.reader.read();return!t.done&&(t.value=Wj(t)),t})}};const iM=(e,t)=>{let n=e=>r([t,e]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function aM(e){return pj(this,arguments,function*(){let t=[],n=`error`,r=!1,i=null,a,o,s=0,c=[],l;function u(){return a===`peek`?Bj(c,o)[0]:([l,c,s]=Bj(c,o),l)}if({cmd:a,size:o}=(yield yield fj((()=>null)()))||{cmd:`read`,size:0},e.isTTY)return yield yield fj(new Uint8Array),yield fj(null);try{t[0]=iM(e,`end`),t[1]=iM(e,`error`);do{if(t[2]=iM(e,`readable`),[n,i]=yield fj(Promise.race(t.map(e=>e[2]))),n===`error`)break;if((r=n===`end`)||(Number.isFinite(o-s)?(l=Wj(e.read(o-s)),l.byteLength0&&(c.push(l),s+=l.byteLength)),r||o<=s)do({cmd:a,size:o}=yield yield fj(u()));while(o{for(let[n,r]of t)e.off(n,r);try{let t=e.destroy;t&&t.call(e,n),n=void 0}catch(e){n=e||n}finally{n==null?r():i(n)}})}})}var oM;(function(e){e[e.V1=0]=`V1`,e[e.V2=1]=`V2`,e[e.V3=2]=`V3`,e[e.V4=3]=`V4`,e[e.V5=4]=`V5`})(oM||={});var sM;(function(e){e[e.Sparse=0]=`Sparse`,e[e.Dense=1]=`Dense`})(sM||={});var cM;(function(e){e[e.HALF=0]=`HALF`,e[e.SINGLE=1]=`SINGLE`,e[e.DOUBLE=2]=`DOUBLE`})(cM||={});var lM;(function(e){e[e.DAY=0]=`DAY`,e[e.MILLISECOND=1]=`MILLISECOND`})(lM||={});var uM;(function(e){e[e.SECOND=0]=`SECOND`,e[e.MILLISECOND=1]=`MILLISECOND`,e[e.MICROSECOND=2]=`MICROSECOND`,e[e.NANOSECOND=3]=`NANOSECOND`})(uM||={});var dM;(function(e){e[e.YEAR_MONTH=0]=`YEAR_MONTH`,e[e.DAY_TIME=1]=`DAY_TIME`,e[e.MONTH_DAY_NANO=2]=`MONTH_DAY_NANO`})(dM||={});const fM=2,pM=4,mM=4,hM=4,gM=new Int32Array(2),_M=new Float32Array(gM.buffer),vM=new Float64Array(gM.buffer),yM=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var bM;(function(e){e[e.UTF8_BYTES=1]=`UTF8_BYTES`,e[e.UTF16_STRING=2]=`UTF16_STRING`})(bM||={});var xM=class e{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){_M[0]=t,this.writeInt32(e,gM[0])}writeFloat64(e,t){vM[0]=t,this.writeInt32(e,gM[yM?0:1]),this.writeInt32(e+4,gM[yM?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]==0?0:e-this.vtable[t]);let r=2;this.addInt16(e-this.object_start);let i=(n+r)*fM;this.addInt16(i);let a=0,o=this.space;outer_loop:for(t=0;t=0;t--)this.writeInt8(e.charCodeAt(t))}this.prep(this.minalign,pM+r),this.addOffset(e),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,r=n-this.bb.readInt32(n),i=t=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){let t=e.endObject();return t}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}},$M=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+hM),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(e){e.startObject(0)}static endUtf8(e){let t=e.endObject();return t}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}},eN;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.FloatingPoint=3]=`FloatingPoint`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct_=13]=`Struct_`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.LargeList=21]=`LargeList`,e[e.RunEndEncoded=22]=`RunEndEncoded`})(eN||={});var tN=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+hM),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):eN.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new NM).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(t,n){let r=this.bb.__offset(this.bb_pos,14);return r?(n||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new PM).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,eN.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){let t=e.endObject();return t}},nN=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+hM),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):AM.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new tN).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new PM).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,AM.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){let t=e.endObject();return t}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(t,n,r,i,a){return e.startSchema(t),e.addEndianness(t,n),e.addFields(t,r),e.addCustomMetadata(t,i),e.addFeatures(t,a),e.endSchema(t)}},rN;(function(e){e[e.NONE=0]=`NONE`,e[e.Schema=1]=`Schema`,e[e.DictionaryBatch=2]=`DictionaryBatch`,e[e.RecordBatch=3]=`RecordBatch`,e[e.Tensor=4]=`Tensor`,e[e.SparseTensor=5]=`SparseTensor`})(rN||={});var Y;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.Float=3]=`Float`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct=13]=`Struct`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.Dictionary=-1]=`Dictionary`,e[e.Int8=-2]=`Int8`,e[e.Int16=-3]=`Int16`,e[e.Int32=-4]=`Int32`,e[e.Int64=-5]=`Int64`,e[e.Uint8=-6]=`Uint8`,e[e.Uint16=-7]=`Uint16`,e[e.Uint32=-8]=`Uint32`,e[e.Uint64=-9]=`Uint64`,e[e.Float16=-10]=`Float16`,e[e.Float32=-11]=`Float32`,e[e.Float64=-12]=`Float64`,e[e.DateDay=-13]=`DateDay`,e[e.DateMillisecond=-14]=`DateMillisecond`,e[e.TimestampSecond=-15]=`TimestampSecond`,e[e.TimestampMillisecond=-16]=`TimestampMillisecond`,e[e.TimestampMicrosecond=-17]=`TimestampMicrosecond`,e[e.TimestampNanosecond=-18]=`TimestampNanosecond`,e[e.TimeSecond=-19]=`TimeSecond`,e[e.TimeMillisecond=-20]=`TimeMillisecond`,e[e.TimeMicrosecond=-21]=`TimeMicrosecond`,e[e.TimeNanosecond=-22]=`TimeNanosecond`,e[e.DenseUnion=-23]=`DenseUnion`,e[e.SparseUnion=-24]=`SparseUnion`,e[e.IntervalDayTime=-25]=`IntervalDayTime`,e[e.IntervalYearMonth=-26]=`IntervalYearMonth`,e[e.DurationSecond=-27]=`DurationSecond`,e[e.DurationMillisecond=-28]=`DurationMillisecond`,e[e.DurationMicrosecond=-29]=`DurationMicrosecond`,e[e.DurationNanosecond=-30]=`DurationNanosecond`})(Y||={});var iN;(function(e){e[e.OFFSET=0]=`OFFSET`,e[e.DATA=1]=`DATA`,e[e.VALIDITY=2]=`VALIDITY`,e[e.TYPE=3]=`TYPE`})(iN||={});const aN=void 0;function oN(e){if(e===null)return`null`;if(e===aN)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>oN(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function sN(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function cN(e,t){return sN(e/t)+sN(e%t)/sN(t)}const lN=Symbol.for(`isArrowBigNum`);function uN(e,...t){return t.length===0?Object.setPrototypeOf(Vj(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}uN.prototype[lN]=!0,uN.prototype.toJSON=function(){return`"${_N(this)}"`},uN.prototype.valueOf=function(e){return gN(this,e)},uN.prototype.toString=function(){return _N(this)},uN.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return gN(this);case`string`:return _N(this);case`default`:return vN(this)}return _N(this)};function dN(...e){return uN.apply(this,e)}function fN(...e){return uN.apply(this,e)}function pN(...e){return uN.apply(this,e)}Object.setPrototypeOf(dN.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(fN.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(pN.prototype,Object.create(Uint32Array.prototype)),Object.assign(dN.prototype,uN.prototype,{constructor:dN,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(fN.prototype,uN.prototype,{constructor:fN,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(pN.prototype,uN.prototype,{constructor:pN,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const mN=BigInt(4294967296)*BigInt(4294967296),hN=mN-BigInt(1);function gN(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<=0)return yN(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(UN.prototype);var WN=class extends UN{constructor(){super(Y.Null)}toString(){return`Null`}};SN=Symbol.toStringTag,WN[SN]=(e=>e[Symbol.toStringTag]=`Null`)(WN.prototype);var GN=class extends UN{constructor(e,t){super(Y.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};CN=Symbol.toStringTag,GN[CN]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(GN.prototype);var KN=class extends GN{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},qN=class extends GN{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},JN=class extends GN{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},YN=class extends GN{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},XN=class extends GN{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},ZN=class extends GN{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},QN=class extends GN{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},$N=class extends GN{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(KN.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(qN.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(JN.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(YN.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(XN.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(ZN.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(QN.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty($N.prototype,`ArrayType`,{value:BigUint64Array});var eP=class extends UN{constructor(e){super(Y.Float),this.precision=e}get ArrayType(){switch(this.precision){case cM.HALF:return Uint16Array;case cM.SINGLE:return Float32Array;case cM.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};wN=Symbol.toStringTag,eP[wN]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(eP.prototype);var tP=class extends eP{constructor(){super(cM.HALF)}},nP=class extends eP{constructor(){super(cM.SINGLE)}},rP=class extends eP{constructor(){super(cM.DOUBLE)}};Object.defineProperty(tP.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(nP.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(rP.prototype,`ArrayType`,{value:Float64Array});var iP=class extends UN{constructor(){super(Y.Binary)}toString(){return`Binary`}};TN=Symbol.toStringTag,iP[TN]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(iP.prototype);var aP=class extends UN{constructor(){super(Y.LargeBinary)}toString(){return`LargeBinary`}};EN=Symbol.toStringTag,aP[EN]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(aP.prototype);var oP=class extends UN{constructor(){super(Y.Utf8)}toString(){return`Utf8`}};DN=Symbol.toStringTag,oP[DN]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(oP.prototype);var sP=class extends UN{constructor(){super(Y.LargeUtf8)}toString(){return`LargeUtf8`}};ON=Symbol.toStringTag,sP[ON]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(sP.prototype);var cP=class extends UN{constructor(){super(Y.Bool)}toString(){return`Bool`}};kN=Symbol.toStringTag,cP[kN]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(cP.prototype);var lP=class extends UN{constructor(e,t,n=128){super(Y.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};AN=Symbol.toStringTag,lP[AN]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(lP.prototype);var uP=class extends UN{constructor(e){super(Y.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${lM[this.unit]}>`}get ArrayType(){return this.unit===lM.DAY?Int32Array:BigInt64Array}};jN=Symbol.toStringTag,uP[jN]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(uP.prototype);var dP=class extends UN{constructor(e,t){super(Y.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${uM[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};MN=Symbol.toStringTag,dP[MN]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(dP.prototype);var fP=class extends UN{constructor(e,t){super(Y.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${uM[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};NN=Symbol.toStringTag,fP[NN]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(fP.prototype);var pP=class extends UN{constructor(e){super(Y.Interval),this.unit=e}toString(){return`Interval<${dM[this.unit]}>`}};PN=Symbol.toStringTag,pP[PN]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(pP.prototype);var mP=class extends UN{constructor(e){super(Y.Duration),this.unit=e}toString(){return`Duration<${uM[this.unit]}>`}};FN=Symbol.toStringTag,mP[FN]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(mP.prototype);var hP=class extends UN{constructor(e){super(Y.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};IN=Symbol.toStringTag,hP[IN]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(hP.prototype);var gP=class extends UN{constructor(e){super(Y.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};LN=Symbol.toStringTag,gP[LN]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(gP.prototype);var _P=class extends UN{constructor(e,t,n){super(Y.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};RN=Symbol.toStringTag,_P[RN]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(_P.prototype);var vP=class extends UN{constructor(e){super(Y.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};zN=Symbol.toStringTag,vP[zN]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(vP.prototype);var yP=class extends UN{constructor(e,t){super(Y.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};BN=Symbol.toStringTag,yP[BN]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(yP.prototype);var bP=class extends UN{constructor(e,t=!1){var n,r,i;if(super(Y.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};VN=Symbol.toStringTag,bP[VN]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(bP.prototype);const xP=(e=>()=>++e)(-1);var SP=class extends UN{constructor(e,t,n,r){super(Y.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?xP():sN(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};HN=Symbol.toStringTag,SP[HN]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(SP.prototype);function CP(e){let t=e;switch(e.typeId){case Y.Decimal:return e.bitWidth/32;case Y.Interval:return 1+t.unit;case Y.FixedSizeList:return t.listSize;case Y.FixedSizeBinary:return t.byteWidth;default:return 1}}var wP=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return TP(this,e,t)}getVisitFnByTypeId(e,t=!0){return EP(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function TP(e,t,n=!0){return typeof t==`number`?EP(e,t,n):typeof t==`string`&&t in Y?EP(e,Y[t],n):t&&t instanceof UN?EP(e,DP(t),n):t?.type&&t.type instanceof UN?EP(e,DP(t.type),n):EP(e,Y.NONE,n)}function EP(e,t,n=!0){let r=null;switch(t){case Y.Null:r=e.visitNull;break;case Y.Bool:r=e.visitBool;break;case Y.Int:r=e.visitInt;break;case Y.Int8:r=e.visitInt8||e.visitInt;break;case Y.Int16:r=e.visitInt16||e.visitInt;break;case Y.Int32:r=e.visitInt32||e.visitInt;break;case Y.Int64:r=e.visitInt64||e.visitInt;break;case Y.Uint8:r=e.visitUint8||e.visitInt;break;case Y.Uint16:r=e.visitUint16||e.visitInt;break;case Y.Uint32:r=e.visitUint32||e.visitInt;break;case Y.Uint64:r=e.visitUint64||e.visitInt;break;case Y.Float:r=e.visitFloat;break;case Y.Float16:r=e.visitFloat16||e.visitFloat;break;case Y.Float32:r=e.visitFloat32||e.visitFloat;break;case Y.Float64:r=e.visitFloat64||e.visitFloat;break;case Y.Utf8:r=e.visitUtf8;break;case Y.LargeUtf8:r=e.visitLargeUtf8;break;case Y.Binary:r=e.visitBinary;break;case Y.LargeBinary:r=e.visitLargeBinary;break;case Y.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case Y.Date:r=e.visitDate;break;case Y.DateDay:r=e.visitDateDay||e.visitDate;break;case Y.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case Y.Timestamp:r=e.visitTimestamp;break;case Y.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case Y.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case Y.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case Y.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case Y.Time:r=e.visitTime;break;case Y.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case Y.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case Y.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case Y.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case Y.Decimal:r=e.visitDecimal;break;case Y.List:r=e.visitList;break;case Y.Struct:r=e.visitStruct;break;case Y.Union:r=e.visitUnion;break;case Y.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case Y.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case Y.Dictionary:r=e.visitDictionary;break;case Y.Interval:r=e.visitInterval;break;case Y.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case Y.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case Y.Duration:r=e.visitDuration;break;case Y.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case Y.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case Y.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case Y.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case Y.FixedSizeList:r=e.visitFixedSizeList;break;case Y.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${Y[t]}'`)}function DP(e){switch(e.typeId){case Y.Null:return Y.Null;case Y.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?Y.Int8:Y.Uint8;case 16:return n?Y.Int16:Y.Uint16;case 32:return n?Y.Int32:Y.Uint32;case 64:return n?Y.Int64:Y.Uint64}return Y.Int}case Y.Float:switch(e.precision){case cM.HALF:return Y.Float16;case cM.SINGLE:return Y.Float32;case cM.DOUBLE:return Y.Float64}return Y.Float;case Y.Binary:return Y.Binary;case Y.LargeBinary:return Y.LargeBinary;case Y.Utf8:return Y.Utf8;case Y.LargeUtf8:return Y.LargeUtf8;case Y.Bool:return Y.Bool;case Y.Decimal:return Y.Decimal;case Y.Time:switch(e.unit){case uM.SECOND:return Y.TimeSecond;case uM.MILLISECOND:return Y.TimeMillisecond;case uM.MICROSECOND:return Y.TimeMicrosecond;case uM.NANOSECOND:return Y.TimeNanosecond}return Y.Time;case Y.Timestamp:switch(e.unit){case uM.SECOND:return Y.TimestampSecond;case uM.MILLISECOND:return Y.TimestampMillisecond;case uM.MICROSECOND:return Y.TimestampMicrosecond;case uM.NANOSECOND:return Y.TimestampNanosecond}return Y.Timestamp;case Y.Date:switch(e.unit){case lM.DAY:return Y.DateDay;case lM.MILLISECOND:return Y.DateMillisecond}return Y.Date;case Y.Interval:switch(e.unit){case dM.DAY_TIME:return Y.IntervalDayTime;case dM.YEAR_MONTH:return Y.IntervalYearMonth}return Y.Interval;case Y.Duration:switch(e.unit){case uM.SECOND:return Y.DurationSecond;case uM.MILLISECOND:return Y.DurationMillisecond;case uM.MICROSECOND:return Y.DurationMicrosecond;case uM.NANOSECOND:return Y.DurationNanosecond}return Y.Duration;case Y.Map:return Y.Map;case Y.List:return Y.List;case Y.Struct:return Y.Struct;case Y.Union:switch(e.mode){case sM.Dense:return Y.DenseUnion;case sM.Sparse:return Y.SparseUnion}return Y.Union;case Y.FixedSizeBinary:return Y.FixedSizeBinary;case Y.FixedSizeList:return Y.FixedSizeList;case Y.Dictionary:return Y.Dictionary}throw Error(`Unrecognized type '${Y[e.typeId]}'`)}wP.prototype.visitInt8=null,wP.prototype.visitInt16=null,wP.prototype.visitInt32=null,wP.prototype.visitInt64=null,wP.prototype.visitUint8=null,wP.prototype.visitUint16=null,wP.prototype.visitUint32=null,wP.prototype.visitUint64=null,wP.prototype.visitFloat16=null,wP.prototype.visitFloat32=null,wP.prototype.visitFloat64=null,wP.prototype.visitDateDay=null,wP.prototype.visitDateMillisecond=null,wP.prototype.visitTimestampSecond=null,wP.prototype.visitTimestampMillisecond=null,wP.prototype.visitTimestampMicrosecond=null,wP.prototype.visitTimestampNanosecond=null,wP.prototype.visitTimeSecond=null,wP.prototype.visitTimeMillisecond=null,wP.prototype.visitTimeMicrosecond=null,wP.prototype.visitTimeNanosecond=null,wP.prototype.visitDenseUnion=null,wP.prototype.visitSparseUnion=null,wP.prototype.visitIntervalDayTime=null,wP.prototype.visitIntervalYearMonth=null,wP.prototype.visitDuration=null,wP.prototype.visitDurationSecond=null,wP.prototype.visitDurationMillisecond=null,wP.prototype.visitDurationMicrosecond=null,wP.prototype.visitDurationNanosecond=null;const OP=new Float64Array(1),kP=new Uint32Array(OP.buffer);function AP(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function jP(e){if(e!==e)return 32256;OP[0]=e;let t=(kP[1]&2147483648)>>16&65535,n=kP[1]&2146435072,r=0;return n>=1089470464?kP[0]>0?n=31744:(n=(n&2080374784)>>16,r=(kP[1]&1048575)>>10):n<=1056964608?(r=1048576+(kP[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(kP[1]&1048575)+512>>10),t|n|r&65535}var MP=class extends wP{};function NP(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const PP=(e,t,n)=>{e[t]=Math.floor(n/864e5)},FP=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},RP=({values:e},t,n)=>{e[t]=n},zP=({values:e},t,n)=>{e[t]=jP(n)},BP=(e,t,n)=>{switch(e.type.precision){case cM.HALF:return zP(e,t,n);case cM.SINGLE:case cM.DOUBLE:return RP(e,t,n)}},VP=({values:e},t,n)=>{PP(e,t,n.valueOf())},HP=({values:e},t,n)=>{e[t]=BigInt(n)},UP=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},WP=({values:e,valueOffsets:t},n,r)=>FP(e,t,n,r),GP=({values:e,valueOffsets:t},n,r)=>FP(e,t,n,yj(r)),KP=(e,t,n)=>{e.type.unit===lM.DAY?VP(e,t,n):HP(e,t,n)},qP=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},JP=({values:e},t,n)=>{e[t]=BigInt(n)},YP=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},XP=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},ZP=(e,t,n)=>{switch(e.type.unit){case uM.SECOND:return qP(e,t,n);case uM.MILLISECOND:return JP(e,t,n);case uM.MICROSECOND:return YP(e,t,n);case uM.NANOSECOND:return XP(e,t,n)}},QP=({values:e},t,n)=>{e[t]=n},$P=({values:e},t,n)=>{e[t]=n},eF=({values:e},t,n)=>{e[t]=n},tF=({values:e},t,n)=>{e[t]=n},nF=(e,t,n)=>{switch(e.type.unit){case uM.SECOND:return QP(e,t,n);case uM.MILLISECOND:return $P(e,t,n);case uM.MICROSECOND:return eF(e,t,n);case uM.NANOSECOND:return tF(e,t,n)}},rF=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},iF=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=wF.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=wF.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},oF=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),sF=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),cF=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),lF=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),uF=(e,t,n)=>{let r=e.type.children.map(e=>wF.getVisitFn(e.type)),i=n instanceof Map?cF(t,n):n instanceof CL?sF(t,n):Array.isArray(n)?oF(t,n):lF(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},dF=(e,t,n)=>{e.type.mode===sM.Dense?fF(e,t,n):pF(e,t,n)},fF=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];wF.visit(i,e.valueOffsets[t],n)},pF=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];wF.visit(i,t,n)},mF=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},hF=(e,t,n)=>{e.type.unit===dM.DAY_TIME?gF(e,t,n):_F(e,t,n)},gF=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},_F=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},vF=({values:e},t,n)=>{e[t]=n},yF=({values:e},t,n)=>{e[t]=n},bF=({values:e},t,n)=>{e[t]=n},xF=({values:e},t,n)=>{e[t]=n},SF=(e,t,n)=>{switch(e.type.unit){case uM.SECOND:return vF(e,t,n);case uM.MILLISECOND:return yF(e,t,n);case uM.MICROSECOND:return bF(e,t,n);case uM.NANOSECOND:return xF(e,t,n)}},CF=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=wF.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${oN(e)}: ${oN(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new OF(this[TF],this[EF])}},OF=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[TF].type.children.findIndex(e=>e.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[TF].type.children.findIndex(e=>e.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[TF].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=bI.visit(e[TF].children[n],e[EF]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[TF].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(wF.visit(e[TF].children[r],e[EF],n),Reflect.set(e,t,n))}},AF=class extends wP{};function jF(e){return(t,n)=>t.getValid(n)?e(t,n):null}const MF=(e,t)=>864e5*e[t],NF=(e,t)=>null,PF=(e,t,n)=>{if(n+1>=t.length)return null;let r=sN(t[n]),i=sN(t[n+1]);return e.subarray(r,i)},FF=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<MF(e,t),LF=({values:e},t)=>sN(e[t]),RF=({stride:e,values:t},n)=>t[e*n],zF=({stride:e,values:t},n)=>AP(t[e*n]),BF=({values:e},t)=>e[t],VF=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),HF=({values:e,valueOffsets:t},n)=>PF(e,t,n),UF=({values:e,valueOffsets:t},n)=>{let r=PF(e,t,n);return r===null?null:_j(r)},WF=({values:e},t)=>e[t],GF=({type:e,values:t},n)=>e.precision===cM.HALF?AP(t[n]):t[n],KF=(e,t)=>e.type.unit===lM.DAY?IF(e,t):LF(e,t),qF=({values:e},t)=>1e3*sN(e[t]),JF=({values:e},t)=>sN(e[t]),YF=({values:e},t)=>cN(e[t],BigInt(1e3)),XF=({values:e},t)=>cN(e[t],BigInt(1e6)),ZF=(e,t)=>{switch(e.type.unit){case uM.SECOND:return qF(e,t);case uM.MILLISECOND:return JF(e,t);case uM.MICROSECOND:return YF(e,t);case uM.NANOSECOND:return XF(e,t)}},QF=({values:e},t)=>e[t],$F=({values:e},t)=>e[t],eI=({values:e},t)=>e[t],tI=({values:e},t)=>e[t],nI=(e,t)=>{switch(e.type.unit){case uM.SECOND:return QF(e,t);case uM.MILLISECOND:return $F(e,t);case uM.MICROSECOND:return eI(e,t);case uM.NANOSECOND:return tI(e,t)}},rI=({values:e,stride:t},n)=>bN.decimal(e.subarray(t*n,t*(n+1))),iI=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new CL([c])},aI=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new TI(o.slice(i,a-i))},oI=(e,t)=>new DF(e,t),sI=(e,t)=>e.type.mode===sM.Dense?cI(e,t):lI(e,t),cI=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return bI.visit(r,e.valueOffsets[t])},lI=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return bI.visit(r,t)},uI=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},dI=(e,t)=>e.type.unit===dM.DAY_TIME?fI(e,t):pI(e,t),fI=({values:e},t)=>e.subarray(2*t,2*(t+1)),pI=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},mI=({values:e},t)=>e[t],hI=({values:e},t)=>e[t],gI=({values:e},t)=>e[t],_I=({values:e},t)=>e[t],vI=(e,t)=>{switch(e.type.unit){case uM.SECOND:return mI(e,t);case uM.MILLISECOND:return hI(e,t);case uM.MICROSECOND:return gI(e,t);case uM.NANOSECOND:return _I(e,t)}},yI=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new CL([a])};AF.prototype.visitNull=jF(NF),AF.prototype.visitBool=jF(FF),AF.prototype.visitInt=jF(WF),AF.prototype.visitInt8=jF(RF),AF.prototype.visitInt16=jF(RF),AF.prototype.visitInt32=jF(RF),AF.prototype.visitInt64=jF(BF),AF.prototype.visitUint8=jF(RF),AF.prototype.visitUint16=jF(RF),AF.prototype.visitUint32=jF(RF),AF.prototype.visitUint64=jF(BF),AF.prototype.visitFloat=jF(GF),AF.prototype.visitFloat16=jF(zF),AF.prototype.visitFloat32=jF(RF),AF.prototype.visitFloat64=jF(RF),AF.prototype.visitUtf8=jF(UF),AF.prototype.visitLargeUtf8=jF(UF),AF.prototype.visitBinary=jF(HF),AF.prototype.visitLargeBinary=jF(HF),AF.prototype.visitFixedSizeBinary=jF(VF),AF.prototype.visitDate=jF(KF),AF.prototype.visitDateDay=jF(IF),AF.prototype.visitDateMillisecond=jF(LF),AF.prototype.visitTimestamp=jF(ZF),AF.prototype.visitTimestampSecond=jF(qF),AF.prototype.visitTimestampMillisecond=jF(JF),AF.prototype.visitTimestampMicrosecond=jF(YF),AF.prototype.visitTimestampNanosecond=jF(XF),AF.prototype.visitTime=jF(nI),AF.prototype.visitTimeSecond=jF(QF),AF.prototype.visitTimeMillisecond=jF($F),AF.prototype.visitTimeMicrosecond=jF(eI),AF.prototype.visitTimeNanosecond=jF(tI),AF.prototype.visitDecimal=jF(rI),AF.prototype.visitList=jF(iI),AF.prototype.visitStruct=jF(oI),AF.prototype.visitUnion=jF(sI),AF.prototype.visitDenseUnion=jF(cI),AF.prototype.visitSparseUnion=jF(lI),AF.prototype.visitDictionary=jF(uI),AF.prototype.visitInterval=jF(dI),AF.prototype.visitIntervalDayTime=jF(fI),AF.prototype.visitIntervalYearMonth=jF(pI),AF.prototype.visitDuration=jF(vI),AF.prototype.visitDurationSecond=jF(mI),AF.prototype.visitDurationMillisecond=jF(hI),AF.prototype.visitDurationMicrosecond=jF(gI),AF.prototype.visitDurationNanosecond=jF(_I),AF.prototype.visitFixedSizeList=jF(yI),AF.prototype.visitMap=jF(aI);const bI=new AF,xI=Symbol.for(`keys`),SI=Symbol.for(`vals`),CI=Symbol.for(`kKeysAsStrings`),wI=Symbol.for(`_kKeysAsStrings`);var TI=class{constructor(e){return this[xI]=new CL([e.children[0]]).memoize(),this[SI]=e.children[1],new Proxy(this,new DI)}get[CI](){return this[wI]||(this[wI]=Array.from(this[xI].toArray(),String))}[Symbol.iterator](){return new EI(this[xI],this[SI])}get size(){return this[xI].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[xI],t=this[SI],n={};for(let r=-1,i=e.length;++r`${oN(e)}: ${oN(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},EI=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),bI.visit(this.vals,e)]})}},DI=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[CI]}has(e,t){return e[CI].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[CI].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[CI].indexOf(t);if(n!==-1){let r=bI.visit(Reflect.get(e,SI),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[CI].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(wF.visit(Reflect.get(e,SI),r,n),Reflect.set(e,t,n))}};Object.defineProperties(TI.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[xI]:{writable:!0,enumerable:!1,configurable:!1,value:null},[SI]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wI]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let OI;function kI(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const AI=(e,t)=>e<0?t+e:e,jI=e=>e!==e;function MI(e){let t=typeof e;if(t!==`object`||e===null)return jI(e)?jI:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?Zj(e,t):!1:e instanceof Map?PI(e):Array.isArray(e)?NI(e):e instanceof CL?FI(e):II(e,!0)}function NI(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return RI(e,n);case Map:return BI(e,n,n.keys());case TI:case DF:case Object:case void 0:return BI(e,n,t||Object.keys(n))}return n instanceof CL?zI(e,n):!1}}function RI(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function UI(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength>3):WI(new GI(n,e,t,null,VI)).subarray(0,r)),i}return n}function WI(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var GI=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return KI(e,t,i)+KI(e,r,n)+qI(e,i>>3,r-i>>3)}function qI(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=JI(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=JI(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=JI(a.getUint8(i)),i+=1;return r}function JI(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const YI=-1;var XI=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return UN.isSparseUnion(e)||UN.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(UN.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=YI&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-KI(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=CP(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(UN.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===sM.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(UI(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===Y.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(UI(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[iN.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[iN.TYPE])&&(a[iN.TYPE]=i.subarray(e,e+t)),(i=a[iN.OFFSET])&&(a[iN.OFFSET]=i.subarray(e,e+t+1))||(i=a[iN.DATA])&&(a[iN.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};XI.prototype.children=Object.freeze([]);var ZI=class e extends wP{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new XI(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=Wj(e.data),i=Wj(e.nullBitmap),a=Hj(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new XI(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=Wj(e.data),i=Wj(e.nullBitmap),a=Uj(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new XI(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=Wj(e.data),i=Wj(e.nullBitmap),a=Hj(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new XI(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=Wj(e.data),i=Wj(e.nullBitmap),a=Uj(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new XI(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length/CP(t),nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length/CP(t),nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length/CP(t),nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length/CP(t),nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length/CP(t),nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=Wj(e.nullBitmap),a=Hj(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new XI(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=Wj(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=Vj(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(UN.isSparseUnion(t))return new XI(t,n,a,o,[void 0,void 0,void 0,i],r);let s=Hj(e.valueOffsets);return new XI(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=Wj(t.nullBitmap),a=Vj(n.indices.ArrayType,t.data),{dictionary:o=new CL([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new XI(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length/CP(t),nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=Wj(e.nullBitmap),i=Vj(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new XI(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=Wj(t.nullBitmap),{length:o=i.length/CP(n),nullCount:s=t.nullBitmap?-1:0}=t;return new XI(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=Wj(t.nullBitmap),o=Hj(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new XI(n,r,s,c,[o,void 0,a],[i])}};const QI=new ZI;function $I(e){return QI.visit(e)}var eL=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function nL(e){return e.reduce((e,t)=>e+t.nullCount,0)}function rL(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function iL(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function aL(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function fL(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new GI(n,e.offset+(t||0),e.length,n,VI)){if(!i)return r;++r}return-1}function pL(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case Y.Union:break;case Y.Dictionary:break;default:return fL(e,n)}let r=bI.getVisitFn(e),i=MI(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new eL(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new vL(a)})}var vL=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof XI)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=xL[o.typeId],r=a[0];this.isValid=e=>oL(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,SL[o.typeId]),this._offsets=rL(a);break}this.data=a,this.type=o,this.stride=CP(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return tL(this.data)}get nullCount(){return nL(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${Y[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(AI(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return yL.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(kI(this,t,n,({data:e,_offsets:t},n,r)=>iL(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case Y.Int:case Y.Float:case Y.Decimal:case Y.Time:case Y.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return UN.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(UN.isDictionary(this.type)){let t=new wL(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new wL(this)}unmemoize(){if(UN.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};bL=Symbol.toStringTag,CL[bL]=(e=>{e.type=UN.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(Y).map(e=>Y[e]).filter(e=>typeof e==`number`&&e!==Y.NONE);for(let n of t){let t=bI.getVisitFnByTypeId(n),r=wF.getVisitFnByTypeId(n),i=hL.getVisitFnByTypeId(n);xL[n]={get:t,set:r,indexOf:i},SL[n]=Object.create(e,{isValid:{value:sL(oL)},get:{value:sL(bI.getVisitFnByTypeId(n))},set:{value:cL(wF.getVisitFnByTypeId(n))},indexOf:{value:lL(hL.getVisitFnByTypeId(n))}})}return`Vector`})(CL.prototype);var wL=class e extends CL{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new CL(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},TL=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,n,r){return e.prep(8,24),e.writeInt64(BigInt(r??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(t??0)),e.offset()}},EL=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+hM),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):oM.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new nN).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new TL).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new TL).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new PM).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,oM.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){let t=e.endObject();return t}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}},DL=class e{constructor(e=[],t,n,r=oM.V5){this.fields=e||[],this.metadata=t||new Map,n||=AL(this.fields),this.dictionaries=n,this.metadataVersion=r}get[Symbol.toStringTag](){return`Schema`}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(`, `)} }>`}select(t){let n=new Set(t),r=this.fields.filter(e=>n.has(e.name));return new e(r,this.metadata)}selectAt(t){let n=t.map(e=>this.fields[e]).filter(Boolean);return new e(n,this.metadata)}assign(...t){let n=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),r=[...this.fields],i=kL(kL(new Map,this.metadata),n.metadata),a=n.fields.filter(e=>{let t=r.findIndex(t=>t.name===e.name);return~t?(r[t]=e.clone({metadata:kL(kL(new Map,r[t].metadata),e.metadata)}))&&!1:!0}),o=AL(a,new Map);return new e([...r,...a],i,new Map([...this.dictionaries,...o]))}};DL.prototype.fields=null,DL.prototype.metadata=null,DL.prototype.dictionaries=null;var OL=class e{static new(...t){let[n,r,i,a]=t;return t[0]&&typeof t[0]==`object`&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),a===void 0&&(a=t[0].metadata)),new e(`${n}`,r,i,a)}constructor(e,t,n=!1,r){this.name=e,this.type=t,this.nullable=n,this.metadata=r||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return`Field`}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,a]=t;return!t[0]||typeof t[0]!=`object`?[n=this.name,r=this.type,i=this.nullable,a=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:a=this.metadata}=t[0],e.new(n,r,i,a)}};OL.prototype.type=null,OL.prototype.name=null,OL.prototype.nullable=null,OL.prototype.metadata=null;function kL(e,t){return new Map([...e||new Map,...t||new Map])}function AL(e,t=new Map){for(let n=-1,r=e.length;++n0&&AL(i.children,t)}return t}var jL=SM,ML=xM,NL=class{static decode(e){e=new ML(Wj(e));let t=EL.getRootAsFooter(e),n=DL.decode(t.schema(),new Map,t.version());return new PL(n,t)}static encode(e){let t=new jL,n=DL.encode(t,e.schema);EL.startRecordBatchesVector(t,e.numRecordBatches);for(let n of[...e.recordBatches()].slice().reverse())FL.encode(t,n);let r=t.endVector();EL.startDictionariesVector(t,e.numDictionaries);for(let n of[...e.dictionaryBatches()].slice().reverse())FL.encode(t,n);let i=t.endVector();return EL.startFooter(t),EL.addSchema(t,n),EL.addVersion(t,oM.V5),EL.addRecordBatches(t,r),EL.addDictionaries(t,i),EL.finishFooterBuffer(t,EL.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=oM.V5,n,r){this.schema=e,this.version=t,n&&(this._recordBatches=n),r&&(this._dictionaryBatches=r)}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t=0&&e=0&&e=0&&e=0&&ethis._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return uj(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(IL);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Qj.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Qj.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return uj(this,void 0,void 0,function*(){return yield this.abort(e),IL})}return(e){return uj(this,void 0,void 0,function*(){return yield this.close(),IL})}read(e){return uj(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return uj(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,t)=>{this.resolvers.push({resolve:e,reject:t})}):Promise.resolve(IL)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`AsyncQueue is closed`)}},BL=class extends zL{write(e){if((e=Wj(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?_j(this.toUint8Array(!0)):this.toUint8Array(!1).then(_j)}toUint8Array(e=!1){return e?Bj(this._values)[0]:(()=>uj(this,void 0,void 0,function*(){var e,t,n,r;let i=[],a=0;try{for(var o=!0,s=hj(this),c;c=yield s.next(),e=c.done,!e;o=!0){r=c.value,o=!1;let e=r;i.push(e),a+=e.byteLength}}catch(e){t={error:e}}finally{try{!o&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(t)throw t.error}}return Bj(i,a)[0]}))()}},VL=class{constructor(e){e&&(this.source=new UL(Qj.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},HL=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof BL?this.source=new WL(Qj.fromAsyncIterable(t)):Fj(t)?this.source=new WL(Qj.fromNodeStream(t)):Nj(t)?this.source=new WL(Qj.fromDOMStream(t)):Aj(t)?this.source=new WL(Qj.fromDOMStream(t.body)):Tj(t)?this.source=new WL(Qj.fromIterable(t)):(wj(t)||Ej(t))&&(this.source=new WL(Qj.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},UL=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,`peek`).value}read(e){return this.next(e,`read`).value}next(e,t=`read`){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||IL)}return(e){return Object.create(this.source.return&&this.source.return(e)||IL)}},WL=class{constructor(e){this.source=e,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(e){return uj(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return uj(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return uj(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(e){return uj(this,arguments,void 0,function*(e,t=`read`){return yield this.source.next({cmd:t,size:e})})}throw(e){return uj(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||IL;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return uj(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||IL;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},GL=class extends VL{constructor(e,t){super(),this.position=0,this.buffer=Wj(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),euj(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return uj(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return uj(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${JL(this.buffer[3])} ${JL(this.buffer[2])} ${JL(this.buffer[1])} ${JL(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;n0&&this.readData(e,n)||new Uint8Array}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readDictionary(e){return this.dictionaries.get(e.id)}},nR=class extends tR{constructor(e,t,n,r,i){super(new Uint8Array,t,n,r,i),this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array:WI(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return Vj(Uint8Array,Vj(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return Vj(Uint8Array,Vj(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return UN.isTimestamp(e)||(UN.isInt(e)||UN.isTime(e))&&e.bitWidth===64||UN.isDuration(e)||UN.isDate(e)&&e.unit===lM.MILLISECOND?Vj(Uint8Array,$L.convertArray(n[t])):UN.isDecimal(e)?Vj(Uint8Array,eR.convertArray(n[t])):UN.isBinary(e)||UN.isLargeBinary(e)||UN.isFixedSizeBinary(e)?rR(n[t]):UN.isBool(e)?WI(n[t]):UN.isUtf8(e)||UN.isLargeUtf8(e)?yj(n[t].join(``)):Vj(Uint8Array,Vj(e.ArrayType,n[t].map(e=>+e)))}};function rR(e){let t=e.join(``),n=new Uint8Array(t.length/2);for(let e=0;e>1]=Number.parseInt(t.slice(e,e+2),16);return n}var iR=class extends wP{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function aR(e,t){return t instanceof e.constructor}function oR(e,t){return e===t||aR(e,t)}function sR(e,t){return e===t||aR(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function cR(e,t){return e===t||aR(e,t)&&e.precision===t.precision}function lR(e,t){return e===t||aR(e,t)&&e.byteWidth===t.byteWidth}function uR(e,t){return e===t||aR(e,t)&&e.unit===t.unit}function dR(e,t){return e===t||aR(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function fR(e,t){return e===t||aR(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function pR(e,t){return e===t||aR(e,t)&&e.children.length===t.children.length&&xR.compareManyFields(e.children,t.children)}function mR(e,t){return e===t||aR(e,t)&&e.children.length===t.children.length&&xR.compareManyFields(e.children,t.children)}function hR(e,t){return e===t||aR(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&xR.compareManyFields(e.children,t.children)}function gR(e,t){return e===t||aR(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&xR.visit(e.indices,t.indices)&&xR.visit(e.dictionary,t.dictionary)}function _R(e,t){return e===t||aR(e,t)&&e.unit===t.unit}function vR(e,t){return e===t||aR(e,t)&&e.unit===t.unit}function yR(e,t){return e===t||aR(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&xR.compareManyFields(e.children,t.children)}function bR(e,t){return e===t||aR(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&xR.compareManyFields(e.children,t.children)}iR.prototype.visitNull=oR,iR.prototype.visitBool=oR,iR.prototype.visitInt=sR,iR.prototype.visitInt8=sR,iR.prototype.visitInt16=sR,iR.prototype.visitInt32=sR,iR.prototype.visitInt64=sR,iR.prototype.visitUint8=sR,iR.prototype.visitUint16=sR,iR.prototype.visitUint32=sR,iR.prototype.visitUint64=sR,iR.prototype.visitFloat=cR,iR.prototype.visitFloat16=cR,iR.prototype.visitFloat32=cR,iR.prototype.visitFloat64=cR,iR.prototype.visitUtf8=oR,iR.prototype.visitLargeUtf8=oR,iR.prototype.visitBinary=oR,iR.prototype.visitLargeBinary=oR,iR.prototype.visitFixedSizeBinary=lR,iR.prototype.visitDate=uR,iR.prototype.visitDateDay=uR,iR.prototype.visitDateMillisecond=uR,iR.prototype.visitTimestamp=dR,iR.prototype.visitTimestampSecond=dR,iR.prototype.visitTimestampMillisecond=dR,iR.prototype.visitTimestampMicrosecond=dR,iR.prototype.visitTimestampNanosecond=dR,iR.prototype.visitTime=fR,iR.prototype.visitTimeSecond=fR,iR.prototype.visitTimeMillisecond=fR,iR.prototype.visitTimeMicrosecond=fR,iR.prototype.visitTimeNanosecond=fR,iR.prototype.visitDecimal=oR,iR.prototype.visitList=pR,iR.prototype.visitStruct=mR,iR.prototype.visitUnion=hR,iR.prototype.visitDenseUnion=hR,iR.prototype.visitSparseUnion=hR,iR.prototype.visitDictionary=gR,iR.prototype.visitInterval=_R,iR.prototype.visitIntervalDayTime=_R,iR.prototype.visitIntervalYearMonth=_R,iR.prototype.visitDuration=vR,iR.prototype.visitDurationSecond=vR,iR.prototype.visitDurationMillisecond=vR,iR.prototype.visitDurationMicrosecond=vR,iR.prototype.visitDurationNanosecond=vR,iR.prototype.visitFixedSizeList=yR,iR.prototype.visitMap=bR;const xR=new iR;function SR(e,t){return xR.compareSchemas(e,t)}function CR(e,t){return wR(e,t.map(e=>e.data.concat()))}function wR(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((e,t)=>Math.max(e,t.length),0)},a=0,o=0,s=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(o=1/0,s=-1;++s0&&(r[a++]=$I({type:new gP(n),length:o,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(t=>new kR(e,t))]}function TR(e,t,n,r,i){var a;let o=(t+63&-64)>>3;for(let s=-1,c=r.length;++s=t)l===t?n[s]=c:(n[s]=c.slice(0,t),i.numBatches=Math.max(i.numBatches,r[s].unshift(c.slice(t,l-t))));else{let r=e[s];e[s]=r.clone({nullable:!0}),n[s]=(a=c?._changeLengthAndBackfillNullBitmap(t))??$I({type:r.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var ER,DR=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new DL([]),this._offsets=[0],this;let i,a;t[0]instanceof DL&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(a=t.pop());let o=t=>{if(t){if(t instanceof kR)return[t];if(t instanceof e)return t.batches;if(t instanceof XI){if(t.type instanceof gP)return[new kR(new DL(t.type.children),t)]}else if(Array.isArray(t))return t.flatMap(e=>o(e));else if(typeof t[Symbol.iterator]==`function`)return[...t].flatMap(e=>o(e));else if(typeof t==`object`){let e=Object.keys(t),n=e.map(e=>new CL([t[e]])),r=i??new DL(e.map((e,t)=>new OL(String(e),n[t].type,n[t].nullable))),[,a]=CR(r,n);return a.length===0?[new kR(t)]:a}}return[]},s=t.flatMap(e=>o(e));if(i=(r=i??(n=s[0])?.schema)??new DL([]),!(i instanceof DL))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);for(let e of s){if(!(e instanceof kR))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);if(!SR(i,e.schema))throw TypeError(`Table and inner RecordBatch schemas must be equivalent.`)}this.schema=i,this.batches=s,this._offsets=a??rL(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=nL(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(AI(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?yL.visit(new CL(this.data)):[][Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n ${this.toArray().join(`, - `)}\n]`}concat(...t){let n=this.schema,r=this.data.concat(t.flatMap(({data:e})=>e));return new e(n,r.map(e=>new kR(n,e)))}slice(t,n){let r=this.schema;[t,n]=kI({length:this.numRows},t,n);let i=iL(this.data,this._offsets,t,n);return new e(r,i.map(e=>new kR(r,e)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&et.children[e]);if(t.length===0){let{type:n}=this.schema.fields[e],r=$I({type:n,length:0,nullCount:0});t.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new CL(t)}return null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)?.findIndex(t=>t.name===e),t)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(t));[e[t],o[t]]=[a,n],[r,i]=CR(r,o)}return new e(r,i)}select(e){let t=this.schema.fields.reduce((e,t,n)=>e.set(t.name,n),new Map);return this.selectAt(e.map(e=>t.get(e)).filter(e=>e>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(e=>e.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((e,t,r)=>{let[i,a]=e,o=n.findIndex(e=>e.name===t.name);return~o?a[o]=r:i.push(r),e},[[],[]]),a=this.schema.assign(t.schema),o=[...n.map((e,t)=>[t,i[t]]).map(([e,n])=>n===void 0?this.getChildAt(e):t.getChildAt(n)),...r.map(e=>t.getChildAt(e))].filter(Boolean);return new e(...CR(a,o))}};ER=Symbol.toStringTag,DR[ER]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=sL(oL),e.get=sL(bI.getVisitFn(Y.Struct)),e.set=cL(wF.getVisitFn(Y.Struct)),e.indexOf=lL(hL.getVisitFn(Y.Struct)),`Table`))(DR.prototype);var OR,kR=class e{constructor(...e){switch(e.length){case 2:if([this.schema]=e,!(this.schema instanceof DL)||([,this.data=$I({nullCount:0,type:new gP(this.schema.fields),children:this.schema.fields.map(e=>$I({type:e.type,nullCount:0}))})]=e,!(this.data instanceof XI)))throw TypeError(`RecordBatch constructor expects a [Schema, Data] pair.`);[this.schema,this.data]=AR(this.schema,this.data.children);break;case 1:{let[t]=e,{fields:n,children:r,length:i}=Object.keys(t).reduce((e,n,r)=>(e.children[r]=t[n],e.length=Math.max(e.length,t[n].length),e.fields[r]=OL.new({name:n,type:t[n].type,nullable:!0}),e),{length:0,fields:[],children:[]}),a=new DL(n),o=$I({type:new gP(n),length:i,children:r,nullCount:0});[this.schema,this.data]=AR(a,o.children,i);break}default:throw TypeError(`RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.`)}}get dictionaries(){return this._dictionaries||=jR(this.schema.fields,this.data.children)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return bI.visit(this.data,e)}at(e){return this.get(AI(e,this.numRows))}set(e,t){return wF.visit(this.data,e,t)}indexOf(e,t){return hL.visit(this.data,e,t)}[Symbol.iterator](){return yL.visit(new CL([this.data]))}toArray(){return[...this]}concat(...e){return new DR(this.schema,[this,...e])}slice(t,n){let[r]=new CL([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)?.findIndex(t=>t.name===e))}getChildAt(e){return e>-1&&et.name===e),t)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&tt.name===e);~t&&(i[t]=this.data.children[t])}return new e(n,$I({type:r,length:this.numRows,children:i}))}selectAt(t){let n=this.schema.selectAt(t),r=t.map(e=>this.data.children[e]).filter(Boolean),i=$I({type:new gP(n.fields),length:this.numRows,children:r});return new e(n,i)}};OR=Symbol.toStringTag,kR[OR]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,`RecordBatch`))(kR.prototype);function AR(e,t,n=t.reduce((e,t)=>Math.max(e,t.length),0)){var r;let i=[...e.fields],a=[...t],o=(n+63&-64)>>3;for(let[s,c]of e.fields.entries()){let e=t[s];(!e||e.length!==n)&&(i[s]=c.clone({nullable:!0}),a[s]=(r=e?._changeLengthAndBackfillNullBitmap(n))??$I({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),$I({type:new gP(i),length:n,children:a})]}function jR(e,t,n=new Map){var r,i;if(((r=e?.length)??0)>0&&e?.length===t?.length)for(let r=-1,a=e.length;++r$I({type:e.type})),n=$I({type:new gP(e.fields),nullCount:0,children:t});super(e,n)}},NR=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+hM),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):oM.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):rN.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt(`0`)}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new PM).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,oM.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,rN.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt(`0`))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){let t=e.endObject();return t}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(t,n,r,i,a,o){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,a),e.addCustomMetadata(t,o),e.endMessage(t)}},PR=class extends wP{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return JM.startNull(t),JM.endNull(t)}visitInt(e,t){return MM.startInt(t),MM.addBitWidth(t,e.bitWidth),MM.addIsSigned(t,e.isSigned),MM.endInt(t)}visitFloat(e,t){return HM.startFloatingPoint(t),HM.addPrecision(t,e.precision),HM.endFloatingPoint(t)}visitBinary(e,t){return FM.startBinary(t),FM.endBinary(t)}visitLargeBinary(e,t){return WM.startLargeBinary(t),WM.endLargeBinary(t)}visitBool(e,t){return IM.startBool(t),IM.endBool(t)}visitUtf8(e,t){return $M.startUtf8(t),$M.endUtf8(t)}visitLargeUtf8(e,t){return GM.startLargeUtf8(t),GM.endLargeUtf8(t)}visitDecimal(e,t){return RM.startDecimal(t),RM.addScale(t,e.scale),RM.addPrecision(t,e.precision),RM.addBitWidth(t,e.bitWidth),RM.endDecimal(t)}visitDate(e,t){return LM.startDate(t),LM.addUnit(t,e.unit),LM.endDate(t)}visitTime(e,t){return XM.startTime(t),XM.addUnit(t,e.unit),XM.addBitWidth(t,e.bitWidth),XM.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return ZM.startTimestamp(t),ZM.addUnit(t,e.unit),n!==void 0&&ZM.addTimezone(t,n),ZM.endTimestamp(t)}visitInterval(e,t){return UM.startInterval(t),UM.addUnit(t,e.unit),UM.endInterval(t)}visitDuration(e,t){return zM.startDuration(t),zM.addUnit(t,e.unit),zM.endDuration(t)}visitList(e,t){return KM.startList(t),KM.endList(t)}visitStruct(e,t){return YM.startStruct_(t),YM.endStruct_(t)}visitUnion(e,t){QM.startTypeIdsVector(t,e.typeIds.length);let n=QM.createTypeIdsVector(t,e.typeIds);return QM.startUnion(t),QM.addMode(t,e.mode),QM.addTypeIds(t,n),QM.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return NM.startDictionaryEncoding(t),NM.addId(t,BigInt(e.id)),NM.addIsOrdered(t,e.isOrdered),n!==void 0&&NM.addIndexType(t,n),NM.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return BM.startFixedSizeBinary(t),BM.addByteWidth(t,e.byteWidth),BM.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return VM.startFixedSizeList(t),VM.addListSize(t,e.listSize),VM.endFixedSizeList(t)}visitMap(e,t){return qM.startMap(t),qM.addKeysSorted(t,e.keysSorted),qM.endMap(t)}};const FR=new PR;function IR(e,t=new Map){return new DL(zR(e,t),GR(e.metadata),t)}function LR(e){return new ZR(e.count,VR(e.columns),HR(e.columns))}function RR(e){return new QR(LR(e.data),e.id,e.isDelta)}function zR(e,t){return(e.fields||[]).filter(Boolean).map(e=>OL.fromJSON(e,t))}function BR(e,t){return(e.children||[]).filter(Boolean).map(e=>OL.fromJSON(e,t))}function VR(e){return(e||[]).reduce((e,t)=>[...e,new ez(t.count,UR(t.VALIDITY)),...VR(t.children)],[])}function HR(e,t=[]){for(let n=-1,r=(e||[]).length;++ne+ +(t===0),0)}function WR(e,t){let n,r,i,a,o,s;return!t||!(a=e.dictionary)?(o=qR(e,BR(e,t)),i=new OL(e.name,o,e.nullable,GR(e.metadata))):t.has(n=a.id)?(r=(r=a.indexType)?KR(r):new JN,s=new SP(t.get(n),r,n,a.isOrdered),i=new OL(e.name,s,e.nullable,GR(e.metadata))):(r=(r=a.indexType)?KR(r):new JN,t.set(n,o=qR(e,BR(e,t))),s=new SP(o,r,n,a.isOrdered),i=new OL(e.name,s,e.nullable,GR(e.metadata))),i||null}function GR(e=[]){return new Map(e.map(({key:e,value:t})=>[e,t]))}function KR(e){return new GN(e.isSigned,e.bitWidth)}function qR(e,t){let n=e.type.name;switch(n){case`NONE`:return new WN;case`null`:return new WN;case`binary`:return new iP;case`largebinary`:return new aP;case`utf8`:return new oP;case`largeutf8`:return new sP;case`bool`:return new cP;case`list`:return new hP((t||[])[0]);case`struct`:return new gP(t||[]);case`struct_`:return new gP(t||[])}switch(n){case`int`:{let t=e.type;return new GN(t.isSigned,t.bitWidth)}case`floatingpoint`:{let t=e.type;return new eP(cM[t.precision])}case`decimal`:{let t=e.type;return new lP(t.scale,t.precision,t.bitWidth)}case`date`:{let t=e.type;return new uP(lM[t.unit])}case`time`:{let t=e.type;return new dP(uM[t.unit],t.bitWidth)}case`timestamp`:{let t=e.type;return new fP(uM[t.unit],t.timezone)}case`interval`:{let t=e.type;return new pP(dM[t.unit])}case`duration`:{let t=e.type;return new mP(uM[t.unit])}case`union`:{let n=e.type,[r,...i]=(n.mode+``).toLowerCase(),a=r.toUpperCase()+i.join(``);return new _P(sM[a],n.typeIds||[],t||[])}case`fixedsizebinary`:{let t=e.type;return new vP(t.byteWidth)}case`fixedsizelist`:{let n=e.type;return new yP(n.listSize,(t||[])[0])}case`map`:{let n=e.type;return new bP((t||[])[0],n.keysSorted)}}throw Error(`Unrecognized type: "${n}"`)}var JR=SM,YR=xM,XR=class e{static fromJSON(t,n){let r=new e(0,oM.V5,n);return r._createHeader=tz(t,n),r}static decode(t){t=new YR(Wj(t));let n=NR.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),a=n.headerType(),o=new e(r,i,a);return o._createHeader=nz(n,a),o}static encode(e){let t=new JR,n=-1;return e.isSchema()?n=DL.encode(t,e.header()):e.isRecordBatch()?n=ZR.encode(t,e.header()):e.isDictionaryBatch()&&(n=QR.encode(t,e.header())),NR.startMessage(t),NR.addVersion(t,oM.V5),NR.addHeader(t,n),NR.addHeaderType(t,e.headerType),NR.addBodyLength(t,BigInt(e.bodyLength)),NR.finishMessageBuffer(t,NR.endMessage(t)),t.asUint8Array()}static from(t,n=0){if(t instanceof DL)return new e(0,oM.V5,rN.Schema,t);if(t instanceof ZR)return new e(n,oM.V5,rN.RecordBatch,t);if(t instanceof QR)return new e(n,oM.V5,rN.DictionaryBatch,t);throw Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===rN.Schema}isRecordBatch(){return this.headerType===rN.RecordBatch}isDictionaryBatch(){return this.headerType===rN.DictionaryBatch}constructor(e,t,n,r){this._version=t,this._headerType=n,this.body=new Uint8Array,r&&(this._createHeader=()=>r),this._bodyLength=sN(e)}},ZR=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,n){this._nodes=t,this._buffers=n,this._length=sN(e)}},QR=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=sN(t)}},$R=class{constructor(e,t){this.offset=sN(e),this.length=sN(t)}},ez=class{constructor(e,t){this.length=sN(e),this.nullCount=sN(t)}};function tz(e,t){return()=>{switch(t){case rN.Schema:return DL.fromJSON(e);case rN.RecordBatch:return ZR.fromJSON(e);case rN.DictionaryBatch:return QR.fromJSON(e)}throw Error(`Unrecognized Message type: { name: ${rN[t]}, type: ${t} }`)}}function nz(e,t){return()=>{switch(t){case rN.Schema:return DL.decode(e.header(new nN),new Map,e.version());case rN.RecordBatch:return ZR.decode(e.header(new OM),e.version());case rN.DictionaryBatch:return QR.decode(e.header(new kM),e.version())}throw Error(`Unrecognized Message type: { name: ${rN[t]}, type: ${t} }`)}}OL.encode=_z,OL.decode=fz,OL.fromJSON=WR,DL.encode=gz,DL.decode=rz,DL.fromJSON=IR,ZR.encode=vz,ZR.decode=iz,ZR.fromJSON=LR,QR.encode=yz,QR.decode=az,QR.fromJSON=RR,ez.encode=bz,ez.decode=sz,$R.encode=xz,$R.decode=oz;function rz(e,t=new Map,n=oM.V5){let r=uz(e,t);return new DL(r,pz(e),t,n)}function iz(e,t=oM.V5){if(e.compression()!==null)throw Error(`Record batch compression not implemented`);return new ZR(e.length(),cz(e),lz(e,t))}function az(e,t=oM.V5){return new QR(ZR.decode(e.data(),t),e.id(),e.isDelta())}function oz(e){return new $R(e.offset(),e.length())}function sz(e){return new ez(e.length(),e.nullCount())}function cz(e){let t=[];for(let n,r=-1,i=-1,a=e.nodesLength();++rOL.encode(e,t));nN.startFieldsVector(e,n.length);let r=nN.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?nN.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return PM.startKeyValue(e),PM.addKey(e,r),PM.addValue(e,i),PM.endKeyValue(e)})):-1;return nN.startSchema(e),nN.addFields(e,r),nN.addEndianness(e,Sz?AM.Little:AM.Big),i!==-1&&nN.addCustomMetadata(e,i),nN.endSchema(e)}function _z(e,t){let n=-1,r=-1,i=-1,a=t.type,o=t.typeId;UN.isDictionary(a)?(o=a.dictionary.typeId,i=FR.visit(a,e),r=FR.visit(a.dictionary,e)):r=FR.visit(a,e);let s=(a.children||[]).map(t=>OL.encode(e,t)),c=tN.createChildrenVector(e,s),l=t.metadata&&t.metadata.size>0?tN.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return PM.startKeyValue(e),PM.addKey(e,r),PM.addValue(e,i),PM.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),tN.startField(e),tN.addType(e,r),tN.addTypeType(e,o),tN.addChildren(e,c),tN.addNullable(e,!!t.nullable),n!==-1&&tN.addName(e,n),i!==-1&&tN.addDictionary(e,i),l!==-1&&tN.addCustomMetadata(e,l),tN.endField(e)}function vz(e,t){let n=t.nodes||[],r=t.buffers||[];OM.startNodesVector(e,n.length);for(let t of n.slice().reverse())ez.encode(e,t);let i=e.endVector();OM.startBuffersVector(e,r.length);for(let t of r.slice().reverse())$R.encode(e,t);let a=e.endVector();return OM.startRecordBatch(e),OM.addLength(e,BigInt(t.length)),OM.addNodes(e,i),OM.addBuffers(e,a),OM.endRecordBatch(e)}function yz(e,t){let n=ZR.encode(e,t.data);return kM.startDictionaryBatch(e),kM.addId(e,BigInt(t.id)),kM.addIsDelta(e,t.isDelta),kM.addData(e,n),kM.endDictionaryBatch(e)}function bz(e,t){return DM.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function xz(e,t){return EM.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const Sz=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),Cz=e=>`Expected ${rN[e]} Message in stream, but was null or length 0.`,wz=e=>`Header pointer of flatbuffer-encoded ${rN[e]} Message is null or length 0.`,Tz=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,Ez=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;var Dz=class{constructor(e){this.source=e instanceof VL?e:new VL(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?IL:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(Cz(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array;let t=Wj(this.source.read(e));if(t.byteLength[...e,...n.VALIDITY&&[n.VALIDITY]||[],...n.TYPE_ID&&[n.TYPE_ID]||[],...n.OFFSET&&[n.OFFSET]||[],...n.DATA&&[n.DATA]||[],...t(n.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(Cz(e));return t.value}readSchema(){let e=rN.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw Error(wz(e));return n}};const Az=4,jz=`ARROW1`,Mz=new Uint8Array(jz.length);for(let e=0;ethis):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Qj.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Qj.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}static from(t){return t instanceof e?t:Dj(t)?Zz(t):kj(t)?eB(t):wj(t)?(()=>uj(this,void 0,void 0,function*(){return yield e.from(yield t)}))():Aj(t)||Nj(t)||Fj(t)||Ej(t)?$z(new HL(t)):Qz(new VL(t))}static readAll(t){return t instanceof e?t.isSync()?Yz(t):Xz(t):Dj(t)||ArrayBuffer.isView(t)||Tj(t)||Oj(t)?Yz(t):Xz(t)}},Rz=class extends Lz{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return pj(this,arguments,function*(){yield fj(yield*mj(hj(this[Symbol.iterator]())))})}},zz=class extends Lz{constructor(e){super(e),this._impl=e}readAll(){return uj(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=hj(this),s;s=yield o.next(),e=s.done,!e;a=!0){r=s.value,a=!1;let e=r;i.push(e)}}catch(e){t={error:e}}finally{try{!a&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw Error(`AsyncRecordBatchStreamReader is not Iterable`)}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Bz=class extends Rz{constructor(e){super(e),this._impl=e}},Vz=class extends zz{constructor(e){super(e),this._impl=e}},Hz=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let n=this._loadVectors(e,t,this.schema.fields),r=$I({type:new gP(this.schema.fields),length:e.length,children:n});return new kR(this.schema,r)}_loadDictionaryBatch(e,t){let{id:n,isDelta:r}=e,{dictionaries:i,schema:a}=this,o=i.get(n),s=a.dictionaries.get(n),c=this._loadVectors(e.data,t,[s]);return(o&&r?o.concat(new CL(c)):new CL(c)).memoize()}_loadVectors(e,t,n){return new tR(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},Uz=class extends Hz{constructor(e,t){super(t),this._reader=Dj(e)?new kz(this._handle=e):new Dz(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=Jz(this,e),(this.schema||=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):IL}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):IL}next(){if(this.closed)return IL;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new MR(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Wz=class extends Hz{constructor(e,t){super(t),this._reader=new Oz(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return uj(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return uj(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Jz(this,e),(this.schema||=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return uj(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):IL})}return(e){return uj(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):IL})}next(){return uj(this,void 0,void 0,function*(){if(this.closed)return IL;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new MR(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return uj(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},Gz=class extends Uz{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof GL?e:new GL(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let n=(t=this._footer)?.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(rN.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null}_readDictionaryBatch(e){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(rN.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}}_readFooter(){let{_handle:e}=this,t=e.size-Fz,n=e.readInt32(t),r=e.readAt(t-n,n);return NL.decode(r)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return uj(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return uj(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let n=(t=this._footer)?.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(rN.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null})}_readDictionaryBatch(e){return uj(this,void 0,void 0,function*(){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(rN.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}})}_readFooter(){return uj(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Fz,n=yield e.readInt32(t),r=yield e.readAt(t-n,n);return NL.decode(r)})}_readNextMessageAndValidate(e){return uj(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Nz(t)?new Bz(new Gz(e.read())):new Rz(new Uz(e)):new Rz(new Uz(function*(){}()))}function $z(e){return uj(this,void 0,void 0,function*(){let t=yield e.peek(Pz+7&-8);return t&&t.byteLength>=4?Nz(t)?new Bz(new Gz(yield e.read())):new zz(new Wz(e)):new zz(new Wz(function(){return pj(this,arguments,function*(){})}()))})}function eB(e){return uj(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new KL(e,t);return t>=Iz&&Nz(yield n.readAt(0,Pz+7&-8))?new Vz(new Kz(n)):new zz(new Wz(n))})}var tB=class e extends wP{static assemble(...t){let n=e=>e.flatMap(e=>Array.isArray(e)?n(e):e instanceof kR?e.data.children:e.data),r=new e;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof CL)return this.visitMany(e.data),this;let{type:t}=e;if(!UN.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw RangeError(`Cannot write arrays larger than 2^31 - 1 in length`);if(UN.isUnion(t))this.nodes.push(new ez(n,0));else{let{nullCount:r}=e;UN.isNull(t)||nB.call(this,r<=0?new Uint8Array:UI(e.offset,n,e.nullBitmap)),this.nodes.push(new ez(n,r))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function nB(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new $R(this._byteLength,t)),this._byteLength+=t,this}function rB(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:a}=e;if(nB.call(this,i),n.mode===sM.Sparse)return cB.call(this,e);if(n.mode===sM.Dense){if(e.offset<=0)return nB.call(this,a),cB.call(this,e);{let o=new Int32Array(r),s=Object.create(null),c=Object.create(null);for(let e,n,l=-1;++l{let i=n.typeIds[t],a=s[i],o=c[i];return e.slice(a,Math.min(r,o))}))}}return this}function iB(e){let t;return e.nullCount>=e.length?nB.call(this,new Uint8Array):(t=e.values)instanceof Uint8Array?nB.call(this,UI(e.offset,e.length,t)):nB.call(this,WI(e.values))}function aB(e){return nB.call(this,e.values.subarray(0,e.length*e.stride))}function oB(e){let{length:t,values:n,valueOffsets:r}=e,i=sN(r[0]),a=sN(r[t]),o=Math.min(a-i,n.byteLength-i);return nB.call(this,Xj(-i,t+1,r)),nB.call(this,n.subarray(i,i+o)),this}function sB(e){let{length:t,valueOffsets:n}=e;if(n){let{0:r,[t]:i}=n;return nB.call(this,Xj(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function cB(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}tB.prototype.visitBool=iB,tB.prototype.visitInt=aB,tB.prototype.visitFloat=aB,tB.prototype.visitUtf8=oB,tB.prototype.visitLargeUtf8=oB,tB.prototype.visitBinary=oB,tB.prototype.visitLargeBinary=oB,tB.prototype.visitFixedSizeBinary=aB,tB.prototype.visitDate=aB,tB.prototype.visitTimestamp=aB,tB.prototype.visitTime=aB,tB.prototype.visitDecimal=aB,tB.prototype.visitList=sB,tB.prototype.visitStruct=cB,tB.prototype.visitUnion=rB,tB.prototype.visitInterval=aB,tB.prototype.visitDuration=aB,tB.prototype.visitFixedSizeList=sB,tB.prototype.visitMap=sB;var lB=class extends RL{static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}constructor(e){super(),this._position=0,this._started=!1,this._sink=new BL,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Cj(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy==`boolean`?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat==`boolean`?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return wj(e)?e.then(e=>this.writeAll(e)):Ej(e)?pB(this,e):fB(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof BL?this._sink=e:(this._sink=new BL,e&&Mj(e)?this.toDOMStream({type:`bytes`}).pipeTo(e):e&&Pj(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!SR(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null||e instanceof DR&&!(t=e.schema)||e instanceof kR&&!(t=e.schema))return this.finish()&&void 0}else throw Error(`RecordBatchWriter is closed`);if(t&&!SR(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof kR?e instanceof MR||this._writeRecordBatch(e):e instanceof DR?this.writeAll(e.batches):Tj(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,r=XR.encode(e),i=r.byteLength,a=this._writeLegacyIpcFormat?4:8,o=i+a+n&~n,s=o-i-a;return e.headerType===rN.RecordBatch?this._recordBatchBlocks.push(new FL(o,e.bodyLength,this._position)):e.headerType===rN.DictionaryBatch&&this._dictionaryBlocks.push(new FL(o,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-a)),i>0&&this._write(r),this._writePadding(s)}_write(e){if(this._started){let t=Wj(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(XR.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Mz)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:r,buffers:i}=tB.assemble(e),a=new ZR(e.numRows,n,r),o=XR.from(a,t);return this._writeDictionaries(e)._writeMessage(o)._writeBodyBuffers(i)}_writeDictionaryBatch(e,t,n=!1){let{byteLength:r,nodes:i,bufferRegions:a,buffers:o}=tB.assemble(new CL([e])),s=new ZR(e.length,i,a),c=new QR(s,t,n),l=XR.from(c,r);return this._writeMessage(l)._writeBodyBuffers(o)}_writeBodyBuffers(e){let t,n,r;for(let i=-1,a=e.length;++i0&&(this._write(t),(r=(n+7&-8)-n)>0&&this._writePadding(r));return this}_writeDictionaries(e){var t,n;for(let[r,i]of e.dictionaries){let e=(t=i?.data)??[],a=this._seenDictionaries.get(r),o=(n=this._dictionaryDeltaOffsets.get(r))??0;if(!a||a.data[0]!==e[0])for(let[t,n]of e.entries())this._writeDictionaryBatch(n,r,t>0);else if(or.writeAll(e)):Ej(t)?pB(r,t):fB(r,t)}},dB=class e extends lB{static writeAll(t){let n=new e;return wj(t)?t.then(e=>n.writeAll(e)):Ej(t)?pB(n,t):fB(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,n=!1){if(!n&&this._seenDictionaries.has(t))throw Error(`The Arrow File format does not support replacement dictionaries. `);return super._writeDictionaryBatch(e,t,n)}_writeFooter(e){let t=NL.encode(new NL(e,oM.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function fB(e,t){let n=t;t instanceof DR&&(n=t.batches,e.reset(void 0,t.schema));for(let t of n)e.write(t);return e.finish()}function pB(e,t){return uj(this,void 0,void 0,function*(){var n,r,i,a,o,s,c;try{for(n=!0,r=hj(t);i=yield r.next(),a=i.done,!a;n=!0){c=i.value,n=!1;let t=c;e.write(t)}}catch(e){o={error:e}}finally{try{!n&&!a&&(s=r.return)&&(yield s.call(r))}finally{if(o)throw o.error}}return e.finish()})}function mB(e,t=`stream`){return(t===`stream`?uB:dB).writeAll(e).toUint8Array(!0)}var hB=Object.create,gB=Object.defineProperty,_B=Object.getOwnPropertyDescriptor,vB=Object.getOwnPropertyNames,yB=Object.getPrototypeOf,bB=Object.prototype.hasOwnProperty,xB=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),SB=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of vB(t))!bB.call(e,i)&&i!==n&&gB(e,i,{get:()=>t[i],enumerable:!(r=_B(t,i))||r.enumerable});return e},CB=(e,t,n)=>(n=e==null?{}:hB(yB(e)),SB(t||!e||!e.__esModule?gB(n,`default`,{value:e,enumerable:!0}):n,e)),wB=xB((e,t)=>{t.exports=Worker}),TB=(e=>(e[e.UNDEFINED=0]=`UNDEFINED`,e[e.AUTOMATIC=1]=`AUTOMATIC`,e[e.READ_ONLY=2]=`READ_ONLY`,e[e.READ_WRITE=3]=`READ_WRITE`,e))(TB||{}),EB=(e=>(e[e.IDENTIFIER=0]=`IDENTIFIER`,e[e.NUMERIC_CONSTANT=1]=`NUMERIC_CONSTANT`,e[e.STRING_CONSTANT=2]=`STRING_CONSTANT`,e[e.OPERATOR=3]=`OPERATOR`,e[e.KEYWORD=4]=`KEYWORD`,e[e.COMMENT=5]=`COMMENT`,e))(EB||{}),DB=(e=>(e[e.NONE=0]=`NONE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARNING=3]=`WARNING`,e[e.ERROR=4]=`ERROR`,e))(DB||{}),OB=(e=>(e[e.NONE=0]=`NONE`,e[e.CONNECT=1]=`CONNECT`,e[e.DISCONNECT=2]=`DISCONNECT`,e[e.OPEN=3]=`OPEN`,e[e.QUERY=4]=`QUERY`,e[e.INSTANTIATE=5]=`INSTANTIATE`,e))(OB||{}),kB=(e=>(e[e.NONE=0]=`NONE`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`,e[e.START=3]=`START`,e[e.RUN=4]=`RUN`,e[e.CAPTURE=5]=`CAPTURE`,e))(kB||{}),AB=(e=>(e[e.NONE=0]=`NONE`,e[e.WEB_WORKER=1]=`WEB_WORKER`,e[e.NODE_WORKER=2]=`NODE_WORKER`,e[e.BINDINGS=3]=`BINDINGS`,e[e.ASYNC_DUCKDB=4]=`ASYNC_DUCKDB`,e))(AB||{}),jB=class{log(e){}},MB=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},NB=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e))(NB||{}),PB=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),n=Lz.from(t);return console.assert(n.isSync(),`Reader is not sync`),console.assert(n.isFile(),`Reader is not file`),new DR(n)}async send(e,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let n=await this._bindings.startPendingQuery(this._conn,e,t);for(;n==null;)n=await this._bindings.pollPendingQuery(this._conn);let r=new FB(this._bindings,this._conn,n),i=await Lz.from(r);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new IB(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=mB(e,`stream`);await this.insertArrowFromIPCStream(n,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},FB=class{constructor(e,t,n){this.db=e,this.conn=t,this.header=n,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight==null?e=await this.db.fetchQueryResults(this.conn):(e=await this._inFlight,this._inFlight=null),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},IB=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),n=Lz.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new DR(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new FB(this.bindings,this.connectionId,t),r=await Lz.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},LB=(e=>(e.CANCEL_PENDING_QUERY=`CANCEL_PENDING_QUERY`,e.CLOSE_PREPARED=`CLOSE_PREPARED`,e.COLLECT_FILE_STATISTICS=`COLLECT_FILE_STATISTICS`,e.REGISTER_OPFS_FILE_NAME=`REGISTER_OPFS_FILE_NAME`,e.CONNECT=`CONNECT`,e.COPY_FILE_TO_BUFFER=`COPY_FILE_TO_BUFFER`,e.COPY_FILE_TO_PATH=`COPY_FILE_TO_PATH`,e.CREATE_PREPARED=`CREATE_PREPARED`,e.DISCONNECT=`DISCONNECT`,e.DROP_FILE=`DROP_FILE`,e.DROP_FILES=`DROP_FILES`,e.EXPORT_FILE_STATISTICS=`EXPORT_FILE_STATISTICS`,e.FETCH_QUERY_RESULTS=`FETCH_QUERY_RESULTS`,e.FLUSH_FILES=`FLUSH_FILES`,e.GET_FEATURE_FLAGS=`GET_FEATURE_FLAGS`,e.GET_TABLE_NAMES=`GET_TABLE_NAMES`,e.GET_VERSION=`GET_VERSION`,e.GLOB_FILE_INFOS=`GLOB_FILE_INFOS`,e.INSERT_ARROW_FROM_IPC_STREAM=`INSERT_ARROW_FROM_IPC_STREAM`,e.INSERT_CSV_FROM_PATH=`IMPORT_CSV_FROM_PATH`,e.INSERT_JSON_FROM_PATH=`IMPORT_JSON_FROM_PATH`,e.INSTANTIATE=`INSTANTIATE`,e.OPEN=`OPEN`,e.PING=`PING`,e.POLL_PENDING_QUERY=`POLL_PENDING_QUERY`,e.REGISTER_FILE_BUFFER=`REGISTER_FILE_BUFFER`,e.REGISTER_FILE_HANDLE=`REGISTER_FILE_HANDLE`,e.REGISTER_FILE_URL=`REGISTER_FILE_URL`,e.RESET=`RESET`,e.RUN_PREPARED=`RUN_PREPARED`,e.RUN_QUERY=`RUN_QUERY`,e.SEND_PREPARED=`SEND_PREPARED`,e.START_PENDING_QUERY=`START_PENDING_QUERY`,e.TOKENIZE=`TOKENIZE`,e))(LB||{}),RB=(e=>(e.CONNECTION_INFO=`CONNECTION_INFO`,e.ERROR=`ERROR`,e.FEATURE_FLAGS=`FEATURE_FLAGS`,e.FILE_BUFFER=`FILE_BUFFER`,e.FILE_INFOS=`FILE_INFOS`,e.FILE_SIZE=`FILE_SIZE`,e.FILE_STATISTICS=`FILE_STATISTICS`,e.INSTANTIATE_PROGRESS=`INSTANTIATE_PROGRESS`,e.LOG=`LOG`,e.OK=`OK`,e.PREPARED_STATEMENT_ID=`PREPARED_STATEMENT_ID`,e.QUERY_PLAN=`QUERY_PLAN`,e.QUERY_RESULT=`QUERY_RESULT`,e.QUERY_RESULT_CHUNK=`QUERY_RESULT_CHUNK`,e.QUERY_RESULT_HEADER=`QUERY_RESULT_HEADER`,e.QUERY_RESULT_HEADER_OR_NULL=`QUERY_RESULT_HEADER_OR_NULL`,e.REGISTERED_FILE=`REGISTERED_FILE`,e.SCRIPT_TOKENS=`SCRIPT_TOKENS`,e.SUCCESS=`SUCCESS`,e.TABLE_NAMES=`TABLE_NAMES`,e.VERSION_STRING=`VERSION_STRING`,e))(RB||{}),zB=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((e,t)=>{this.promiseResolver=e,this.promiseRejecter=t})}};function BB(e){switch(e.typeId){case Y.Binary:return{sqlType:`binary`};case Y.Bool:return{sqlType:`bool`};case Y.Date:return{sqlType:`date`};case Y.DateDay:return{sqlType:`date32[d]`};case Y.DateMillisecond:return{sqlType:`date64[ms]`};case Y.Decimal:{let t=e;return{sqlType:`decimal`,precision:t.precision,scale:t.scale}}case Y.Float:return{sqlType:`float`};case Y.Float16:return{sqlType:`float16`};case Y.Float32:return{sqlType:`float32`};case Y.Float64:return{sqlType:`float64`};case Y.Int:return{sqlType:`int32`};case Y.Int16:return{sqlType:`int16`};case Y.Int32:return{sqlType:`int32`};case Y.Int64:return{sqlType:`int64`};case Y.Uint16:return{sqlType:`uint16`};case Y.Uint32:return{sqlType:`uint32`};case Y.Uint64:return{sqlType:`uint64`};case Y.Uint8:return{sqlType:`uint8`};case Y.IntervalDayTime:return{sqlType:`interval[dt]`};case Y.IntervalYearMonth:return{sqlType:`interval[m]`};case Y.List:return{sqlType:`list`,valueType:BB(e.valueType)};case Y.FixedSizeBinary:return{sqlType:`fixedsizebinary`,byteWidth:e.byteWidth};case Y.Null:return{sqlType:`null`};case Y.Utf8:return{sqlType:`utf8`};case Y.Struct:return{sqlType:`struct`,fields:e.children.map(e=>VB(e.name,e.type))};case Y.Map:{let t=e;return{sqlType:`map`,keyType:BB(t.keyType),valueType:BB(t.valueType)}}case Y.Time:return{sqlType:`time[s]`};case Y.TimeMicrosecond:return{sqlType:`time[us]`};case Y.TimeMillisecond:return{sqlType:`time[ms]`};case Y.TimeNanosecond:return{sqlType:`time[ns]`};case Y.TimeSecond:return{sqlType:`time[s]`};case Y.Timestamp:return{sqlType:`timestamp`,timezone:e.timezone||void 0};case Y.TimestampSecond:return{sqlType:`timestamp[s]`,timezone:e.timezone||void 0};case Y.TimestampMicrosecond:return{sqlType:`timestamp[us]`,timezone:e.timezone||void 0};case Y.TimestampNanosecond:return{sqlType:`timestamp[ns]`,timezone:e.timezone||void 0};case Y.TimestampMillisecond:return{sqlType:`timestamp[ms]`,timezone:e.timezone||void 0}}throw Error(`unsupported arrow type: ${e.toString()}`)}function VB(e,t){let n=BB(t);return n.name=e,n}var HB=new TextEncoder,UB=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener(`message`,this._onMessageHandler),this._worker.addEventListener(`error`,this._onErrorHandler),this._worker.addEventListener(`close`,this._onCloseHandler),this._workerShutdownPromise=new Promise((e,t)=>{this._workerShutdownResolver=e})}detach(){this._worker&&(this._worker.removeEventListener(`message`,this._onMessageHandler),this._worker.removeEventListener(`error`,this._onErrorHandler),this._worker.removeEventListener(`close`,this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error(`cannot send a message since the worker is not set!`);return}let n=this._nextMessageId++;return this._pendingRequests.set(n,e),this._worker.postMessage({messageId:n,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let n=e.data;switch(n.type){case`LOG`:this._logger.log(n.data);return;case`INSTANTIATE_PROGRESS`:for(let e of this._onInstantiationProgress)e(n.data);return}let r=this._pendingRequests.get(n.requestId);if(!r){console.warn(`unassociated response: [${n.requestId}, ${n.type.toString()}]`);return}if(this._pendingRequests.delete(n.requestId),n.type==`ERROR`){let e=Error(n.data.message);e.name=n.data.name,(t=Object.getOwnPropertyDescriptor(e,`stack`))!=null&&t.writable&&(e.stack=n.data.stack),r.promiseRejecter(e);return}switch(r.type){case`CLOSE_PREPARED`:case`COLLECT_FILE_STATISTICS`:case`REGISTER_OPFS_FILE_NAME`:case`COPY_FILE_TO_PATH`:case`DISCONNECT`:case`DROP_FILE`:case`DROP_FILES`:case`FLUSH_FILES`:case`INSERT_ARROW_FROM_IPC_STREAM`:case`IMPORT_CSV_FROM_PATH`:case`IMPORT_JSON_FROM_PATH`:case`OPEN`:case`PING`:case`REGISTER_FILE_BUFFER`:case`REGISTER_FILE_HANDLE`:case`REGISTER_FILE_URL`:case`RESET`:if(n.type==`OK`){r.promiseResolver(n.data);return}break;case`INSTANTIATE`:if(this._onInstantiationProgress=[],n.type==`OK`){r.promiseResolver(n.data);return}break;case`GLOB_FILE_INFOS`:if(n.type==`FILE_INFOS`){r.promiseResolver(n.data);return}break;case`GET_VERSION`:if(n.type==`VERSION_STRING`){r.promiseResolver(n.data);return}break;case`GET_FEATURE_FLAGS`:if(n.type==`FEATURE_FLAGS`){r.promiseResolver(n.data);return}break;case`GET_TABLE_NAMES`:if(n.type==`TABLE_NAMES`){r.promiseResolver(n.data);return}break;case`TOKENIZE`:if(n.type==`SCRIPT_TOKENS`){r.promiseResolver(n.data);return}break;case`COPY_FILE_TO_BUFFER`:if(n.type==`FILE_BUFFER`){r.promiseResolver(n.data);return}break;case`EXPORT_FILE_STATISTICS`:if(n.type==`FILE_STATISTICS`){r.promiseResolver(n.data);return}break;case`CONNECT`:if(n.type==`CONNECTION_INFO`){r.promiseResolver(n.data);return}break;case`RUN_PREPARED`:case`RUN_QUERY`:if(n.type==`QUERY_RESULT`){r.promiseResolver(n.data);return}break;case`SEND_PREPARED`:if(n.type==`QUERY_RESULT_HEADER`){r.promiseResolver(n.data);return}break;case`START_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`POLL_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`CANCEL_PENDING_QUERY`:if(this._onInstantiationProgress=[],n.type==`SUCCESS`){r.promiseResolver(n.data);return}break;case`FETCH_QUERY_RESULTS`:if(n.type==`QUERY_RESULT_CHUNK`){r.promiseResolver(n.data);return}break;case`CREATE_PREPARED`:if(n.type==`PREPARED_STATEMENT_ID`){r.promiseResolver(n.data);return}break}r.promiseRejecter(Error(`unexpected response type: ${n.type.toString()}`))}onError(e){console.error(e),console.error(`error in duckdb worker: ${e.message}`),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn(`worker terminated with ${this._pendingRequests.size} pending requests`);return}this._pendingRequests.clear()}async reset(){let e=new zB(`RESET`,null);return await this.postTask(e)}async ping(){let e=new zB(`PING`,null);await this.postTask(e)}async dropFile(e){let t=new zB(`DROP_FILE`,e);return await this.postTask(t)}async dropFiles(){let e=new zB(`DROP_FILES`,null);return await this.postTask(e)}async flushFiles(){let e=new zB(`FLUSH_FILES`,null);return await this.postTask(e)}async instantiate(e,t=null,n=e=>{}){this._onInstantiationProgress.push(n);let r=new zB(`INSTANTIATE`,[e,t]);return await this.postTask(r)}async getVersion(){let e=new zB(`GET_VERSION`,null);return await this.postTask(e)}async getFeatureFlags(){let e=new zB(`GET_FEATURE_FLAGS`,null);return await this.postTask(e)}async open(e){let t=new zB(`OPEN`,e);await this.postTask(t)}async tokenize(e){let t=new zB(`TOKENIZE`,e);return await this.postTask(t)}async connectInternal(){let e=new zB(`CONNECT`,null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new PB(this,e)}async disconnect(e){let t=new zB(`DISCONNECT`,e);await this.postTask(t)}async runQuery(e,t){let n=new zB(`RUN_QUERY`,[e,t]);return await this.postTask(n)}async startPendingQuery(e,t,n=!1){let r=new zB(`START_PENDING_QUERY`,[e,t,n]);return await this.postTask(r)}async pollPendingQuery(e){let t=new zB(`POLL_PENDING_QUERY`,e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new zB(`CANCEL_PENDING_QUERY`,e);return await this.postTask(t)}async fetchQueryResults(e){let t=new zB(`FETCH_QUERY_RESULTS`,e);return await this.postTask(t)}async getTableNames(e,t){let n=new zB(`GET_TABLE_NAMES`,[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new zB(`CREATE_PREPARED`,[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new zB(`CLOSE_PREPARED`,[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new zB(`RUN_PREPARED`,[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new zB(`SEND_PREPARED`,[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new zB(`GLOB_FILE_INFOS`,e);return await this.postTask(t)}async registerFileText(e,t){let n=HB.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new zB(`REGISTER_FILE_URL`,[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new zB(`REGISTER_FILE_BUFFER`,[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new zB(`REGISTER_FILE_HANDLE`,[e,t,n,r]);await this.postTask(i,[])}async registerOPFSFileName(e){let t=new zB(`REGISTER_OPFS_FILE_NAME`,[e]);await this.postTask(t,[])}async collectFileStatistics(e,t){let n=new zB(`COLLECT_FILE_STATISTICS`,[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new zB(`EXPORT_FILE_STATISTICS`,e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new zB(`COPY_FILE_TO_BUFFER`,e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new zB(`COPY_FILE_TO_PATH`,[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new zB(`INSERT_ARROW_FROM_IPC_STREAM`,[e,t,n]);await this.postTask(r,[t.buffer])}async insertCSVFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(VB(t,r))}n.columnsFlat=e,delete n.columns}let r=new zB(`IMPORT_CSV_FROM_PATH`,[e,t,n]);await this.postTask(r)}async insertJSONFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(VB(t,r))}n.columnsFlat=e,delete n.columns}let r=new zB(`IMPORT_JSON_FROM_PATH`,[e,t,n]);await this.postTask(r)}};function WB(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<`u`&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var GB=WB(),KB=(e=>(e[e.BUFFER=0]=`BUFFER`,e[e.NODE_FS=1]=`NODE_FS`,e[e.BROWSER_FILEREADER=2]=`BROWSER_FILEREADER`,e[e.BROWSER_FSACCESS=3]=`BROWSER_FSACCESS`,e[e.HTTP=4]=`HTTP`,e[e.S3=5]=`S3`,e))(KB||{}),qB=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])),JB=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])),YB=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])),XB=()=>(async e=>{try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),ZB={name:`@duckdb/duckdb-wasm`,version:`1.29.1-dev68.0`,description:`DuckDB powered by WebAssembly`,license:`MIT`,repository:{type:`git`,url:`https://github.com/duckdb/duckdb-wasm.git`},keywords:[`sql`,`duckdb`,`relational`,`database`,`data`,`query`,`wasm`,`analytics`,`olap`,`arrow`,`parquet`,`json`,`csv`],dependencies:{"apache-arrow":`^17.0.0`},devDependencies:{"@types/emscripten":`^1.39.10`,"@types/jasmine":`^5.1.4`,"@typescript-eslint/eslint-plugin":`^6.21.0`,"@typescript-eslint/parser":`^6.21.0`,esbuild:`^0.20.2`,eslint:`^8.57.0`,"eslint-plugin-jasmine":`^4.1.3`,"eslint-plugin-react":`^7.34.0`,"fast-glob":`^3.3.2`,jasmine:`^5.1.0`,"jasmine-core":`^5.1.2`,"jasmine-spec-reporter":`^7.0.0`,"js-sha256":`^0.11.0`,karma:`^6.4.2`,"karma-chrome-launcher":`^3.2.0`,"karma-coverage":`^2.2.1`,"karma-firefox-launcher":`^2.1.3`,"karma-jasmine":`^5.1.0`,"karma-jasmine-html-reporter":`^2.1.0`,"karma-sourcemap-loader":`^0.4.0`,"karma-spec-reporter":`^0.0.36`,"make-dir":`^4.0.0`,nyc:`^15.1.0`,prettier:`^3.2.5`,puppeteer:`^22.8.0`,rimraf:`^5.0.5`,s3rver:`^3.7.1`,typedoc:`^0.25.13`,typescript:`^5.3.3`,"wasm-feature-detect":`^1.6.1`,"web-worker":`^1.2.0`},scripts:{"build:debug":`node bundle.mjs debug && tsc --emitDeclarationOnly`,"build:release":`node bundle.mjs release && tsc --emitDeclarationOnly`,docs:`typedoc`,report:`node ./coverage.mjs`,"test:node":`node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:debug":`node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:coverage":`nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:firefox":`karma start ./karma/tests-firefox.cjs`,"test:chrome":`karma start ./karma/tests-chrome.cjs`,"test:chrome:eh":`karma start ./karma/tests-chrome-eh.cjs`,"test:chrome:coverage":`karma start ./karma/tests-chrome-coverage.cjs`,"test:browser":`karma start ./karma/tests-all.cjs`,"test:browser:debug":`karma start ./karma/tests-debug.cjs`,test:`npm run test:chrome && npm run test:node`,"test:coverage":`npm run test:chrome:coverage && npm run test:node:coverage && npm run report`,lint:`eslint src test`},files:[`dist`,`!dist/tests-*`,`!dist/duckdb-browser-mvp.worker.js.map`,`!dist/types/test`],main:`dist/duckdb-browser.cjs`,module:`dist/duckdb-browser.mjs`,types:`dist/duckdb-browser.d.ts`,jsdelivr:`dist/duckdb-browser.cjs`,unpkg:`dist/duckdb-browser.mjs`,sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":`./dist/duckdb-mvp.wasm`,"./dist/duckdb-eh.wasm":`./dist/duckdb-eh.wasm`,"./dist/duckdb-coi.wasm":`./dist/duckdb-coi.wasm`,"./dist/duckdb-browser":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser.cjs":`./dist/duckdb-browser.cjs`,"./dist/duckdb-browser.mjs":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser-coi.pthread.worker.js":`./dist/duckdb-browser-coi.pthread.worker.js`,"./dist/duckdb-browser-coi.worker.js":`./dist/duckdb-browser-coi.worker.js`,"./dist/duckdb-browser-eh.worker.js":`./dist/duckdb-browser-eh.worker.js`,"./dist/duckdb-browser-mvp.worker.js":`./dist/duckdb-browser-mvp.worker.js`,"./dist/duckdb-node":`./dist/duckdb-node.cjs`,"./dist/duckdb-node.cjs":`./dist/duckdb-node.cjs`,"./dist/duckdb-node-blocking":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-blocking.cjs":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-eh.worker.cjs":`./dist/duckdb-node-eh.worker.cjs`,"./dist/duckdb-node-mvp.worker.cjs":`./dist/duckdb-node-mvp.worker.cjs`,"./blocking":{node:{types:`./dist/duckdb-node-blocking.d.ts`,require:`./dist/duckdb-node-blocking.cjs`,import:`./dist/duckdb-node-blocking.cjs`},types:`./dist/duckdb-node-blocking.d.ts`,import:`./dist/duckdb-node-blocking.mjs`,require:`./dist/duckdb-node-blocking.cjs`},".":{browser:{types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`},node:{types:`./dist/duckdb-node.d.ts`,import:`./dist/duckdb-node.cjs`,require:`./dist/duckdb-node.cjs`},types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`}}},QB=ZB.name,$B=ZB.version,eV=ZB.version.split(`.`),tV=eV[0],nV=eV[1],rV=eV[2],iV=()=>typeof navigator>`u`,aV=()=>iV()?`node`:navigator.userAgent,oV=()=>aV().includes(`Firefox`),sV=()=>/^((?!chrome|android).)*safari/i.test(aV()),cV=null,lV=null,uV=null,dV=null,fV=null;async function pV(){return cV??=typeof BigInt64Array<`u`,lV??=await JB(),uV??=await XB(),dV??=await YB(),fV??=await qB(),{bigInt64Array:cV,crossOriginIsolated:iV()||globalThis.crossOriginIsolated||!1,wasmExceptions:lV,wasmSIMD:dV,wasmThreads:uV,wasmBulkMemory:fV}}async function mV(e){let t=await pV();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}var hV=CB(wB());const gV=Symbol.for(`constructDateFrom`),_V={},vV={};function yV(e,t){try{let n=_V[e]||(_V[e]=new Intl.DateTimeFormat(`en-GB`,{timeZone:e,hour:`numeric`,timeZoneName:`longOffset`}).format),r=n(t).split(`GMT`)[1]||``;return r in vV?vV[r]:xV(r,r.split(`:`))}catch{if(e in vV)return vV[e];let t=e?.match(bV);return t?xV(e,t.slice(1)):NaN}}const bV=/([+-]\d\d):?(\d\d)?/;function xV(e,t){let n=+t[0],r=+(t[1]||0);return vV[e]=n>0?n*60+r:n*60-r}var SV=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(yV(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),EV(this,NaN),wV(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-yV(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),wV(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};const CV=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!CV.test(e))return;let t=e.replace(CV,`$1UTC`);SV.prototype[t]&&(e.startsWith(`get`)?SV.prototype[e]=function(){return this.internal[t]()}:(SV.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),TV(this),+this},SV.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),wV(this),+this}))});function wV(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function TV(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),EV(e)}function EV(e){let t=yV(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);let r=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),a=r-i,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=r-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=yV(e.timeZone,e),l=-new Date(+e).getTimezoneOffset(),u=l-c,d=c!==t,f=u-s;if(d&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);let t=yV(e.timeZone,e),n=c-t;n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var DV=class e extends SV{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${OV(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=e>0?`-`:`+`,n=String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),r=String(Math.abs(e)%60).padStart(2,`0`);return[t,n,r]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};function OV(e,t){return new Intl.DateTimeFormat(`en-GB`,{timeZone:e,timeZoneName:`long`}).format(t).slice(12)}const kV=new TextDecoder(`utf-8`),AV=e=>kV.decode(e),jV=new TextEncoder,MV=e=>jV.encode(e),NV=e=>typeof e==`function`,PV=e=>e!=null&&Object(e)===e,FV=e=>PV(e)&&NV(e.then),IV=e=>PV(e)&&NV(e[Symbol.iterator]),LV=e=>PV(e)&&NV(e[Symbol.asyncIterator]),RV=e=>PV(e)&&`done`in e&&`value`in e,zV=e=>PV(e)&&NV(e.clear)&&NV(e.bytes)&&NV(e.position)&&NV(e.setPosition)&&NV(e.capacity)&&NV(e.getBufferIdentifier)&&NV(e.createLong);var BV={};xt(BV,{compareArrayLike:()=>TH,joinUint8Arrays:()=>WV,memcpy:()=>UV,rebaseValueOffsets:()=>wH,toArrayBufferView:()=>GV,toArrayBufferViewAsyncIterator:()=>mH,toArrayBufferViewIterator:()=>iH,toBigInt64Array:()=>YV,toBigUint64Array:()=>$V,toFloat32Array:()=>eH,toFloat32ArrayAsyncIterator:()=>xH,toFloat32ArrayIterator:()=>dH,toFloat64Array:()=>tH,toFloat64ArrayAsyncIterator:()=>SH,toFloat64ArrayIterator:()=>fH,toInt16Array:()=>qV,toInt16ArrayAsyncIterator:()=>gH,toInt16ArrayIterator:()=>oH,toInt32Array:()=>JV,toInt32ArrayAsyncIterator:()=>_H,toInt32ArrayIterator:()=>sH,toInt8Array:()=>KV,toInt8ArrayAsyncIterator:()=>hH,toInt8ArrayIterator:()=>aH,toUint16Array:()=>ZV,toUint16ArrayAsyncIterator:()=>yH,toUint16ArrayIterator:()=>lH,toUint32Array:()=>QV,toUint32ArrayAsyncIterator:()=>bH,toUint32ArrayIterator:()=>uH,toUint8Array:()=>XV,toUint8ArrayAsyncIterator:()=>vH,toUint8ArrayIterator:()=>cH,toUint8ClampedArray:()=>nH,toUint8ClampedArrayAsyncIterator:()=>CH,toUint8ClampedArrayIterator:()=>pH});const VV=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function HV(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++cGV(Int8Array,e),qV=e=>GV(Int16Array,e),JV=e=>GV(Int32Array,e),YV=e=>GV(BigInt64Array,e),XV=e=>GV(Uint8Array,e),ZV=e=>GV(Uint16Array,e),QV=e=>GV(Uint32Array,e),$V=e=>GV(BigUint64Array,e),eH=e=>GV(Float32Array,e),tH=e=>GV(Float64Array,e),nH=e=>GV(Uint8ClampedArray,e),rH=e=>(e.next(),e);function*iH(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof VV?n(t):IV(t)?t:n(t);return yield*rH(function*(t){let n=null;do n=t.next(yield GV(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const aH=e=>iH(Int8Array,e),oH=e=>iH(Int16Array,e),sH=e=>iH(Int32Array,e),cH=e=>iH(Uint8Array,e),lH=e=>iH(Uint16Array,e),uH=e=>iH(Uint32Array,e),dH=e=>iH(Float32Array,e),fH=e=>iH(Float64Array,e),pH=e=>iH(Uint8ClampedArray,e);function mH(e,t){return pj(this,arguments,function*(){if(FV(t))return yield fj(yield fj(yield*mj(hj(mH(e,yield fj(t))))));let n=function(e){return pj(this,arguments,function*(){yield yield fj(yield fj(e))})},r=function(e){return pj(this,arguments,function*(){yield fj(yield*mj(hj(rH(function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)}(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof VV?n(t):IV(t)?r(t):LV(t)?t:n(t);return yield fj(yield*mj(hj(rH(function(t){return pj(this,arguments,function*(){let n=null;do n=yield fj(t.next(yield yield fj(GV(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield fj(new e)})}const hH=e=>mH(Int8Array,e),gH=e=>mH(Int16Array,e),_H=e=>mH(Int32Array,e),vH=e=>mH(Uint8Array,e),yH=e=>mH(Uint16Array,e),bH=e=>mH(Uint32Array,e),xH=e=>mH(Float32Array,e),SH=e=>mH(Float64Array,e),CH=e=>mH(Uint8ClampedArray,e);function wH(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++nPH});const NH=void 0;function PH(e){if(e===null)return`null`;if(e===NH)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>PH(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function FH(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function IH(e,t){return FH(e/t)+FH(e%t)/FH(t)}var LH={};xt(LH,{BN:()=>YH,bigNumToBigInt:()=>qH,bigNumToNumber:()=>GH,bigNumToString:()=>KH,isArrowBigNumSymbol:()=>RH});const RH=Symbol.for(`isArrowBigNum`);function zH(e,...t){return t.length===0?Object.setPrototypeOf(GV(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}zH.prototype[RH]=!0,zH.prototype.toJSON=function(){return`"${KH(this)}"`},zH.prototype.valueOf=function(e){return GH(this,e)},zH.prototype.toString=function(){return KH(this)},zH.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return GH(this);case`string`:return KH(this);case`default`:return qH(this)}return KH(this)};function BH(...e){return zH.apply(this,e)}function VH(...e){return zH.apply(this,e)}function HH(...e){return zH.apply(this,e)}Object.setPrototypeOf(BH.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(VH.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(HH.prototype,Object.create(Uint32Array.prototype)),Object.assign(BH.prototype,zH.prototype,{constructor:BH,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(VH.prototype,zH.prototype,{constructor:VH,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(HH.prototype,zH.prototype,{constructor:HH,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const UH=BigInt(4294967296)*BigInt(4294967296),WH=UH-BigInt(1);function GH(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<0){let e=BigInt(`1`.padEnd(t+1,`0`)),n=c/e,r=s?-(c%e):c%e,i=FH(n),a=`${r}`.padStart(t,`0`),o=s&&i===0?`-`:``;return+`${o}${i}.${a}`}return FH(c)}function KH(e){if(e.byteLength===8){let t=new e.BigIntArray(e.buffer,e.byteOffset,1);return`${t[0]}`}if(!e.signed)return JH(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=new Int16Array([t.at(-1)])[0];if(n>=0)return JH(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(vU.prototype);var yU=class extends vU{constructor(){super(X.Null)}toString(){return`Null`}};ZH=Symbol.toStringTag,yU[ZH]=(e=>e[Symbol.toStringTag]=`Null`)(yU.prototype);var bU=class extends vU{constructor(e,t){super(X.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};QH=Symbol.toStringTag,bU[QH]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(bU.prototype);var xU=class extends bU{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},SU=class extends bU{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},CU=class extends bU{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},wU=class extends bU{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},TU=class extends bU{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},EU=class extends bU{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},DU=class extends bU{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},OU=class extends bU{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(xU.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(SU.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(CU.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(wU.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(TU.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(EU.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(DU.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(OU.prototype,`ArrayType`,{value:BigUint64Array});var kU=class extends vU{constructor(e){super(X.Float),this.precision=e}get ArrayType(){switch(this.precision){case DH.HALF:return Uint16Array;case DH.SINGLE:return Float32Array;case DH.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};$H=Symbol.toStringTag,kU[$H]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(kU.prototype);var AU=class extends kU{constructor(){super(DH.HALF)}},jU=class extends kU{constructor(){super(DH.SINGLE)}},MU=class extends kU{constructor(){super(DH.DOUBLE)}};Object.defineProperty(AU.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(jU.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(MU.prototype,`ArrayType`,{value:Float64Array});var NU=class extends vU{constructor(){super(X.Binary)}toString(){return`Binary`}};eU=Symbol.toStringTag,NU[eU]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(NU.prototype);var PU=class extends vU{constructor(){super(X.LargeBinary)}toString(){return`LargeBinary`}};tU=Symbol.toStringTag,PU[tU]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(PU.prototype);var FU=class extends vU{constructor(){super(X.Utf8)}toString(){return`Utf8`}};nU=Symbol.toStringTag,FU[nU]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(FU.prototype);var IU=class extends vU{constructor(){super(X.LargeUtf8)}toString(){return`LargeUtf8`}};rU=Symbol.toStringTag,IU[rU]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(IU.prototype);var LU=class extends vU{constructor(){super(X.Bool)}toString(){return`Bool`}};iU=Symbol.toStringTag,LU[iU]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(LU.prototype);var RU=class extends vU{constructor(e,t,n=128){super(X.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};aU=Symbol.toStringTag,RU[aU]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(RU.prototype);var zU=class extends vU{constructor(e){super(X.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${OH[this.unit]}>`}get ArrayType(){return this.unit===OH.DAY?Int32Array:BigInt64Array}};oU=Symbol.toStringTag,zU[oU]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(zU.prototype);var BU=class extends vU{constructor(e,t){super(X.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${kH[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};sU=Symbol.toStringTag,BU[sU]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(BU.prototype);var VU=class extends vU{constructor(e,t){super(X.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${kH[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};cU=Symbol.toStringTag,VU[cU]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(VU.prototype);var HU=class extends vU{constructor(e){super(X.Interval),this.unit=e}toString(){return`Interval<${AH[this.unit]}>`}};lU=Symbol.toStringTag,HU[lU]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(HU.prototype);var UU=class extends vU{constructor(e){super(X.Duration),this.unit=e}toString(){return`Duration<${kH[this.unit]}>`}};uU=Symbol.toStringTag,UU[uU]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(UU.prototype);var WU=class extends vU{constructor(e){super(X.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};dU=Symbol.toStringTag,WU[dU]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(WU.prototype);var GU=class extends vU{constructor(e){super(X.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};fU=Symbol.toStringTag,GU[fU]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(GU.prototype);var KU=class extends vU{constructor(e,t,n){super(X.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};pU=Symbol.toStringTag,KU[pU]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(KU.prototype);var qU=class extends vU{constructor(e){super(X.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};mU=Symbol.toStringTag,qU[mU]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(qU.prototype);var JU=class extends vU{constructor(e,t){super(X.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};hU=Symbol.toStringTag,JU[hU]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(JU.prototype);var YU=class extends vU{constructor(e,t=!1){var n,r,i;if(super(X.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};gU=Symbol.toStringTag,YU[gU]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(YU.prototype);const XU=(e=>()=>++e)(-1);var ZU=class extends vU{constructor(e,t,n,r){super(X.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?XU():FH(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};_U=Symbol.toStringTag,ZU[_U]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(ZU.prototype);function QU(e){let t=e;switch(e.typeId){case X.Decimal:return e.bitWidth/32;case X.Interval:return t.unit===AH.MONTH_DAY_NANO?4:1+t.unit;case X.FixedSizeList:return t.listSize;case X.FixedSizeBinary:return t.byteWidth;default:return 1}}var $U=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return eW(this,e,t)}getVisitFnByTypeId(e,t=!0){return tW(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function eW(e,t,n=!0){return typeof t==`number`?tW(e,t,n):typeof t==`string`&&t in X?tW(e,X[t],n):t&&t instanceof vU?tW(e,nW(t),n):t?.type&&t.type instanceof vU?tW(e,nW(t.type),n):tW(e,X.NONE,n)}function tW(e,t,n=!0){let r=null;switch(t){case X.Null:r=e.visitNull;break;case X.Bool:r=e.visitBool;break;case X.Int:r=e.visitInt;break;case X.Int8:r=e.visitInt8||e.visitInt;break;case X.Int16:r=e.visitInt16||e.visitInt;break;case X.Int32:r=e.visitInt32||e.visitInt;break;case X.Int64:r=e.visitInt64||e.visitInt;break;case X.Uint8:r=e.visitUint8||e.visitInt;break;case X.Uint16:r=e.visitUint16||e.visitInt;break;case X.Uint32:r=e.visitUint32||e.visitInt;break;case X.Uint64:r=e.visitUint64||e.visitInt;break;case X.Float:r=e.visitFloat;break;case X.Float16:r=e.visitFloat16||e.visitFloat;break;case X.Float32:r=e.visitFloat32||e.visitFloat;break;case X.Float64:r=e.visitFloat64||e.visitFloat;break;case X.Utf8:r=e.visitUtf8;break;case X.LargeUtf8:r=e.visitLargeUtf8;break;case X.Binary:r=e.visitBinary;break;case X.LargeBinary:r=e.visitLargeBinary;break;case X.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case X.Date:r=e.visitDate;break;case X.DateDay:r=e.visitDateDay||e.visitDate;break;case X.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case X.Timestamp:r=e.visitTimestamp;break;case X.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case X.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case X.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case X.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case X.Time:r=e.visitTime;break;case X.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case X.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case X.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case X.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case X.Decimal:r=e.visitDecimal;break;case X.List:r=e.visitList;break;case X.Struct:r=e.visitStruct;break;case X.Union:r=e.visitUnion;break;case X.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case X.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case X.Dictionary:r=e.visitDictionary;break;case X.Interval:r=e.visitInterval;break;case X.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case X.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case X.IntervalMonthDayNano:r=e.visitIntervalMonthDayNano||e.visitInterval;break;case X.Duration:r=e.visitDuration;break;case X.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case X.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case X.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case X.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case X.FixedSizeList:r=e.visitFixedSizeList;break;case X.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${X[t]}'`)}function nW(e){switch(e.typeId){case X.Null:return X.Null;case X.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?X.Int8:X.Uint8;case 16:return n?X.Int16:X.Uint16;case 32:return n?X.Int32:X.Uint32;case 64:return n?X.Int64:X.Uint64}return X.Int}case X.Float:switch(e.precision){case DH.HALF:return X.Float16;case DH.SINGLE:return X.Float32;case DH.DOUBLE:return X.Float64}return X.Float;case X.Binary:return X.Binary;case X.LargeBinary:return X.LargeBinary;case X.Utf8:return X.Utf8;case X.LargeUtf8:return X.LargeUtf8;case X.Bool:return X.Bool;case X.Decimal:return X.Decimal;case X.Time:switch(e.unit){case kH.SECOND:return X.TimeSecond;case kH.MILLISECOND:return X.TimeMillisecond;case kH.MICROSECOND:return X.TimeMicrosecond;case kH.NANOSECOND:return X.TimeNanosecond}return X.Time;case X.Timestamp:switch(e.unit){case kH.SECOND:return X.TimestampSecond;case kH.MILLISECOND:return X.TimestampMillisecond;case kH.MICROSECOND:return X.TimestampMicrosecond;case kH.NANOSECOND:return X.TimestampNanosecond}return X.Timestamp;case X.Date:switch(e.unit){case OH.DAY:return X.DateDay;case OH.MILLISECOND:return X.DateMillisecond}return X.Date;case X.Interval:switch(e.unit){case AH.DAY_TIME:return X.IntervalDayTime;case AH.YEAR_MONTH:return X.IntervalYearMonth;case AH.MONTH_DAY_NANO:return X.IntervalMonthDayNano}return X.Interval;case X.Duration:switch(e.unit){case kH.SECOND:return X.DurationSecond;case kH.MILLISECOND:return X.DurationMillisecond;case kH.MICROSECOND:return X.DurationMicrosecond;case kH.NANOSECOND:return X.DurationNanosecond}return X.Duration;case X.Map:return X.Map;case X.List:return X.List;case X.Struct:return X.Struct;case X.Union:switch(e.mode){case EH.Dense:return X.DenseUnion;case EH.Sparse:return X.SparseUnion}return X.Union;case X.FixedSizeBinary:return X.FixedSizeBinary;case X.FixedSizeList:return X.FixedSizeList;case X.Dictionary:return X.Dictionary}throw Error(`Unrecognized type '${X[e.typeId]}'`)}$U.prototype.visitInt8=null,$U.prototype.visitInt16=null,$U.prototype.visitInt32=null,$U.prototype.visitInt64=null,$U.prototype.visitUint8=null,$U.prototype.visitUint16=null,$U.prototype.visitUint32=null,$U.prototype.visitUint64=null,$U.prototype.visitFloat16=null,$U.prototype.visitFloat32=null,$U.prototype.visitFloat64=null,$U.prototype.visitDateDay=null,$U.prototype.visitDateMillisecond=null,$U.prototype.visitTimestampSecond=null,$U.prototype.visitTimestampMillisecond=null,$U.prototype.visitTimestampMicrosecond=null,$U.prototype.visitTimestampNanosecond=null,$U.prototype.visitTimeSecond=null,$U.prototype.visitTimeMillisecond=null,$U.prototype.visitTimeMicrosecond=null,$U.prototype.visitTimeNanosecond=null,$U.prototype.visitDenseUnion=null,$U.prototype.visitSparseUnion=null,$U.prototype.visitIntervalDayTime=null,$U.prototype.visitIntervalYearMonth=null,$U.prototype.visitIntervalMonthDayNano=null,$U.prototype.visitDuration=null,$U.prototype.visitDurationSecond=null,$U.prototype.visitDurationMillisecond=null,$U.prototype.visitDurationMicrosecond=null,$U.prototype.visitDurationNanosecond=null;var rW={};xt(rW,{float64ToUint16:()=>sW,uint16ToFloat64:()=>oW});const iW=new Float64Array(1),aW=new Uint32Array(iW.buffer);function oW(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function sW(e){if(e!==e)return 32256;iW[0]=e;let t=(aW[1]&2147483648)>>16&65535,n=aW[1]&2146435072,r=0;return n>=1089470464?aW[0]>0?n=31744:(n=(n&2080374784)>>16,r=(aW[1]&1048575)>>10):n<=1056964608?(r=1048576+(aW[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(aW[1]&1048575)+512>>10),t|n|r&65535}var cW=class extends $U{};function lW(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const uW=(e,t,n)=>{e[t]=Math.floor(n/864e5)},dW=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},mW=({values:e},t,n)=>{e[t]=n},hW=({values:e},t,n)=>{e[t]=sW(n)},gW=(e,t,n)=>{switch(e.type.precision){case DH.HALF:return hW(e,t,n);case DH.SINGLE:case DH.DOUBLE:return mW(e,t,n)}},_W=({values:e},t,n)=>{uW(e,t,n.valueOf())},vW=({values:e},t,n)=>{e[t]=BigInt(n)},yW=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},bW=({values:e,valueOffsets:t},n,r)=>dW(e,t,n,r),xW=({values:e,valueOffsets:t},n,r)=>dW(e,t,n,MV(r)),SW=(e,t,n)=>{e.type.unit===OH.DAY?_W(e,t,n):vW(e,t,n)},CW=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},wW=({values:e},t,n)=>{e[t]=BigInt(n)},TW=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},EW=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},DW=(e,t,n)=>{switch(e.type.unit){case kH.SECOND:return CW(e,t,n);case kH.MILLISECOND:return wW(e,t,n);case kH.MICROSECOND:return TW(e,t,n);case kH.NANOSECOND:return EW(e,t,n)}},OW=({values:e},t,n)=>{e[t]=n},kW=({values:e},t,n)=>{e[t]=n},AW=({values:e},t,n)=>{e[t]=n},jW=({values:e},t,n)=>{e[t]=n},MW=(e,t,n)=>{switch(e.type.unit){case kH.SECOND:return OW(e,t,n);case kH.MILLISECOND:return kW(e,t,n);case kH.MICROSECOND:return AW(e,t,n);case kH.NANOSECOND:return jW(e,t,n)}},NW=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},PW=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=tG.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=tG.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},IW=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),LW=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),RW=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),zW=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),BW=(e,t,n)=>{let r=e.type.children.map(e=>tG.getVisitFn(e.type)),i=n instanceof Map?RW(t,n):n instanceof iq?LW(t,n):Array.isArray(n)?IW(t,n):zW(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},VW=(e,t,n)=>{e.type.mode===EH.Dense?HW(e,t,n):UW(e,t,n)},HW=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];tG.visit(i,e.valueOffsets[t],n)},UW=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];tG.visit(i,t,n)},WW=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},GW=(e,t,n)=>{switch(e.type.unit){case AH.YEAR_MONTH:return qW(e,t,n);case AH.DAY_TIME:return KW(e,t,n);case AH.MONTH_DAY_NANO:return JW(e,t,n)}},KW=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},qW=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},JW=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},YW=({values:e},t,n)=>{e[t]=n},XW=({values:e},t,n)=>{e[t]=n},ZW=({values:e},t,n)=>{e[t]=n},QW=({values:e},t,n)=>{e[t]=n},$W=(e,t,n)=>{switch(e.type.unit){case kH.SECOND:return YW(e,t,n);case kH.MILLISECOND:return XW(e,t,n);case kH.MICROSECOND:return ZW(e,t,n);case kH.NANOSECOND:return QW(e,t,n)}},eG=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=tG.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${PH(e)}: ${PH(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new aG(this[nG],this[rG])}},aG=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[nG].type.children.some(e=>e.name===t)}getOwnPropertyDescriptor(e,t){if(e[nG].type.children.some(e=>e.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[nG].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=$G.visit(e[nG].children[n],e[rG]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[nG].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(tG.visit(e[nG].children[r],e[rG],n),Reflect.set(e,t,n))}};const sG=new oG;var cG=class extends $U{};function lG(e){return(t,n)=>t.getValid(n)?e(t,n):null}const uG=(e,t)=>864e5*e[t],dG=(e,t)=>null,fG=(e,t,n)=>{if(n+1>=t.length)return null;let r=FH(t[n]),i=FH(t[n+1]);return e.subarray(r,i)},pG=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<uG(e,t),hG=({values:e},t)=>FH(e[t]),gG=({stride:e,values:t},n)=>t[e*n],_G=({stride:e,values:t},n)=>oW(t[e*n]),vG=({values:e},t)=>e[t],yG=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),bG=({values:e,valueOffsets:t},n)=>fG(e,t,n),xG=({values:e,valueOffsets:t},n)=>{let r=fG(e,t,n);return r===null?null:AV(r)},SG=({values:e},t)=>e[t],CG=({type:e,values:t},n)=>e.precision===DH.HALF?oW(t[n]):t[n],wG=(e,t)=>e.type.unit===OH.DAY?mG(e,t):hG(e,t),TG=({values:e},t)=>1e3*FH(e[t]),EG=({values:e},t)=>FH(e[t]),DG=({values:e},t)=>IH(e[t],BigInt(1e3)),OG=({values:e},t)=>IH(e[t],BigInt(1e6)),kG=(e,t)=>{switch(e.type.unit){case kH.SECOND:return TG(e,t);case kH.MILLISECOND:return EG(e,t);case kH.MICROSECOND:return DG(e,t);case kH.NANOSECOND:return OG(e,t)}},AG=({values:e},t)=>e[t],jG=({values:e},t)=>e[t],MG=({values:e},t)=>e[t],NG=({values:e},t)=>e[t],PG=(e,t)=>{switch(e.type.unit){case kH.SECOND:return AG(e,t);case kH.MILLISECOND:return jG(e,t);case kH.MICROSECOND:return MG(e,t);case kH.NANOSECOND:return NG(e,t)}},FG=({values:e,stride:t},n)=>YH.decimal(e.subarray(t*n,t*(n+1))),IG=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new iq([c])},LG=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new iK(o.slice(i,a-i))},RG=(e,t)=>new iG(e,t),zG=(e,t)=>e.type.mode===EH.Dense?BG(e,t):VG(e,t),BG=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return $G.visit(r,e.valueOffsets[t])},VG=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return $G.visit(r,t)},HG=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},UG=(e,t)=>e.type.unit===AH.MONTH_DAY_NANO?KG(e,t):e.type.unit===AH.DAY_TIME?WG(e,t):GG(e,t),WG=({values:e},t)=>e.subarray(2*t,2*(t+1)),GG=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},KG=({values:e},t)=>e.subarray(4*t,4*(t+1)),qG=({values:e},t)=>e[t],JG=({values:e},t)=>e[t],YG=({values:e},t)=>e[t],XG=({values:e},t)=>e[t],ZG=(e,t)=>{switch(e.type.unit){case kH.SECOND:return qG(e,t);case kH.MILLISECOND:return JG(e,t);case kH.MICROSECOND:return YG(e,t);case kH.NANOSECOND:return XG(e,t)}},QG=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new iq([a])};cG.prototype.visitNull=lG(dG),cG.prototype.visitBool=lG(pG),cG.prototype.visitInt=lG(SG),cG.prototype.visitInt8=lG(gG),cG.prototype.visitInt16=lG(gG),cG.prototype.visitInt32=lG(gG),cG.prototype.visitInt64=lG(vG),cG.prototype.visitUint8=lG(gG),cG.prototype.visitUint16=lG(gG),cG.prototype.visitUint32=lG(gG),cG.prototype.visitUint64=lG(vG),cG.prototype.visitFloat=lG(CG),cG.prototype.visitFloat16=lG(_G),cG.prototype.visitFloat32=lG(gG),cG.prototype.visitFloat64=lG(gG),cG.prototype.visitUtf8=lG(xG),cG.prototype.visitLargeUtf8=lG(xG),cG.prototype.visitBinary=lG(bG),cG.prototype.visitLargeBinary=lG(bG),cG.prototype.visitFixedSizeBinary=lG(yG),cG.prototype.visitDate=lG(wG),cG.prototype.visitDateDay=lG(mG),cG.prototype.visitDateMillisecond=lG(hG),cG.prototype.visitTimestamp=lG(kG),cG.prototype.visitTimestampSecond=lG(TG),cG.prototype.visitTimestampMillisecond=lG(EG),cG.prototype.visitTimestampMicrosecond=lG(DG),cG.prototype.visitTimestampNanosecond=lG(OG),cG.prototype.visitTime=lG(PG),cG.prototype.visitTimeSecond=lG(AG),cG.prototype.visitTimeMillisecond=lG(jG),cG.prototype.visitTimeMicrosecond=lG(MG),cG.prototype.visitTimeNanosecond=lG(NG),cG.prototype.visitDecimal=lG(FG),cG.prototype.visitList=lG(IG),cG.prototype.visitStruct=lG(RG),cG.prototype.visitUnion=lG(zG),cG.prototype.visitDenseUnion=lG(BG),cG.prototype.visitSparseUnion=lG(VG),cG.prototype.visitDictionary=lG(HG),cG.prototype.visitInterval=lG(UG),cG.prototype.visitIntervalDayTime=lG(WG),cG.prototype.visitIntervalYearMonth=lG(GG),cG.prototype.visitIntervalMonthDayNano=lG(KG),cG.prototype.visitDuration=lG(ZG),cG.prototype.visitDurationSecond=lG(qG),cG.prototype.visitDurationMillisecond=lG(JG),cG.prototype.visitDurationMicrosecond=lG(YG),cG.prototype.visitDurationNanosecond=lG(XG),cG.prototype.visitFixedSizeList=lG(QG),cG.prototype.visitMap=lG(LG);const $G=new cG,eK=Symbol.for(`keys`),tK=Symbol.for(`vals`),nK=Symbol.for(`kKeysAsStrings`),rK=Symbol.for(`_kKeysAsStrings`);var iK=class{constructor(e){return this[eK]=new iq([e.children[0]]).memoize(),this[tK]=e.children[1],new Proxy(this,new oK)}get[nK](){return this[rK]||(this[rK]=Array.from(this[eK].toArray(),String))}[Symbol.iterator](){return new aK(this[eK],this[tK])}get size(){return this[eK].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[eK],t=this[tK],n={};for(let r=-1,i=e.length;++r`${PH(e)}: ${PH(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},aK=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),$G.visit(this.vals,e)]})}},oK=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[nK]}has(e,t){return e[nK].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[nK].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[nK].indexOf(t);if(n!==-1){let r=$G.visit(Reflect.get(e,tK),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[nK].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(tG.visit(Reflect.get(e,tK),r,n),Reflect.set(e,t,n))}};Object.defineProperties(iK.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[eK]:{writable:!0,enumerable:!1,configurable:!1,value:null},[tK]:{writable:!0,enumerable:!1,configurable:!1,value:null},[rK]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var sK={};xt(sK,{clampRange:()=>lK,createElementComparator:()=>fK,wrapIndex:()=>uK});let cK;function lK(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const uK=(e,t)=>e<0?t+e:e,dK=e=>e!==e;function fK(e){let t=typeof e;if(t!==`object`||e===null)return dK(e)?dK:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?TH(e,t):!1:e instanceof Map?mK(e):Array.isArray(e)?pK(e):e instanceof iq?hK(e):gK(e,!0)}function pK(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return vK(e,n);case Map:return bK(e,n,n.keys());case iK:case iG:case Object:case void 0:return bK(e,n,t||Object.keys(n))}return n instanceof iq?yK(e,n):!1}}function vK(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++rDK,getBit:()=>CK,getBool:()=>SK,packBools:()=>EK,popcnt_array:()=>kK,popcnt_bit_range:()=>OK,popcnt_uint32:()=>AK,setBool:()=>wK,truncateBitmap:()=>TK});function SK(e,t,n,r){return(n&1<>r}function wK(e,t,n){return n?!!(e[t>>3]|=1<>3]&=~(1<0||n.byteLength>3):EK(new DK(n,e,t,null,SK)).subarray(0,r)),i}return n}function EK(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var DK=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return OK(e,t,i)+OK(e,r,n)+kK(e,i>>3,r-i>>3)}function kK(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=AK(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=AK(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=AK(a.getUint8(i)),i+=1;return r}function AK(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const jK=-1;var MK=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return vU.isSparseUnion(e)||vU.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(vU.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=jK&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-OK(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=QU(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(vU.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===EH.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(TK(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===X.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(TK(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[jH.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[jH.TYPE])&&(a[jH.TYPE]=i.subarray(e,e+t)),(i=a[jH.OFFSET])&&(a[jH.OFFSET]=i.subarray(e,e+t+1))||(i=a[jH.DATA])&&(a[jH.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};MK.prototype.children=Object.freeze([]);var NK=class e extends $U{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new MK(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=XV(e.data),i=XV(e.nullBitmap),a=JV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=XV(e.data),i=XV(e.nullBitmap),a=YV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=XV(e.data),i=XV(e.nullBitmap),a=JV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=XV(e.data),i=XV(e.nullBitmap),a=YV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=XV(e.nullBitmap),a=JV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=XV(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=GV(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(vU.isSparseUnion(t))return new MK(t,n,a,o,[void 0,void 0,void 0,i],r);let s=JV(e.valueOffsets);return new MK(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=XV(t.nullBitmap),a=GV(n.indices.ArrayType,t.data),{dictionary:o=new iq([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new MK(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=XV(t.nullBitmap),{length:o=i.length/QU(n),nullCount:s=t.nullBitmap?-1:0}=t;return new MK(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=XV(t.nullBitmap),o=JV(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new MK(n,r,s,c,[o,void 0,a],[i])}};const PK=new NK;var FK=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function LK(e){return e.reduce((e,t)=>e+t.nullCount,0)}function RK(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function zK(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function BK(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function qK(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new DK(n,e.offset+(t||0),e.length,n,SK)){if(!i)return r;++r}return-1}function JK(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case X.Union:break;case X.Dictionary:break;default:return qK(e,n)}let r=$G.getVisitFn(e),i=fK(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new FK(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new $K(a)})}var $K=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof MK)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=nq[o.typeId],r=a[0];this.isValid=e=>VK(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,rq[o.typeId]),this._offsets=RK(a);break}this.data=a,this.type=o,this.stride=QU(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return IK(this.data)}get nullCount(){return LK(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${X[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(uK(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return eq.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(lK(this,t,n,({data:e,_offsets:t},n,r)=>zK(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case X.Int:case X.Float:case X.Decimal:case X.Time:case X.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return vU.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(vU.isDictionary(this.type)){let t=new aq(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new aq(this)}unmemoize(){if(vU.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};tq=Symbol.toStringTag,iq[tq]=(e=>{e.type=vU.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(X).map(e=>X[e]).filter(e=>typeof e==`number`&&e!==X.NONE);for(let n of t){let t=$G.getVisitFnByTypeId(n),r=tG.getVisitFnByTypeId(n),i=XK.getVisitFnByTypeId(n);nq[n]={get:t,set:r,indexOf:i},rq[n]=Object.create(e,{isValid:{value:HK(VK)},get:{value:HK($G.getVisitFnByTypeId(n))},set:{value:UK(tG.getVisitFnByTypeId(n))},indexOf:{value:WK(XK.getVisitFnByTypeId(n))}})}return`Vector`})(iq.prototype);var aq=class e extends iq{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new iq(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},oq={};xt(oq,{BaseInt64:()=>dq,Int128:()=>mq,Int64:()=>pq,Uint64:()=>fq});const sq=65536;function cq(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const lq=8,uq=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];var dq=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${cq(this.buffer[3])} ${cq(this.buffer[2])} ${cq(this.buffer[1])} ${cq(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;ngq,toIntervalDayTimeObjects:()=>vq,toIntervalMonthDayNanoInt32Array:()=>_q,toIntervalMonthDayNanoObjects:()=>yq});function gq(e){var t,n;let r=e.length,i=new Int32Array(r*2);for(let a=0,o=0;a>BigInt(32))):o+=2}return i}function vq(e){let t=e.length,n=Array(t/2);for(let r=0,i=0;r>>0);r[a++]={months:e[i],days:e[i+1],nanoseconds:t?`${n}`:n}}return r}var bq=class extends $U{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function xq(e,t){return t instanceof e.constructor}function Sq(e,t){return e===t||xq(e,t)}function Cq(e,t){return e===t||xq(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function wq(e,t){return e===t||xq(e,t)&&e.precision===t.precision}function Tq(e,t){return e===t||xq(e,t)&&e.byteWidth===t.byteWidth}function Eq(e,t){return e===t||xq(e,t)&&e.unit===t.unit}function Dq(e,t){return e===t||xq(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Oq(e,t){return e===t||xq(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function kq(e,t){return e===t||xq(e,t)&&e.children.length===t.children.length&&Lq.compareManyFields(e.children,t.children)}function Aq(e,t){return e===t||xq(e,t)&&e.children.length===t.children.length&&Lq.compareManyFields(e.children,t.children)}function jq(e,t){return e===t||xq(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&Lq.compareManyFields(e.children,t.children)}function Mq(e,t){return e===t||xq(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Lq.visit(e.indices,t.indices)&&Lq.visit(e.dictionary,t.dictionary)}function Nq(e,t){return e===t||xq(e,t)&&e.unit===t.unit}function Pq(e,t){return e===t||xq(e,t)&&e.unit===t.unit}function Fq(e,t){return e===t||xq(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Lq.compareManyFields(e.children,t.children)}function Iq(e,t){return e===t||xq(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Lq.compareManyFields(e.children,t.children)}bq.prototype.visitNull=Sq,bq.prototype.visitBool=Sq,bq.prototype.visitInt=Cq,bq.prototype.visitInt8=Cq,bq.prototype.visitInt16=Cq,bq.prototype.visitInt32=Cq,bq.prototype.visitInt64=Cq,bq.prototype.visitUint8=Cq,bq.prototype.visitUint16=Cq,bq.prototype.visitUint32=Cq,bq.prototype.visitUint64=Cq,bq.prototype.visitFloat=wq,bq.prototype.visitFloat16=wq,bq.prototype.visitFloat32=wq,bq.prototype.visitFloat64=wq,bq.prototype.visitUtf8=Sq,bq.prototype.visitLargeUtf8=Sq,bq.prototype.visitBinary=Sq,bq.prototype.visitLargeBinary=Sq,bq.prototype.visitFixedSizeBinary=Tq,bq.prototype.visitDate=Eq,bq.prototype.visitDateDay=Eq,bq.prototype.visitDateMillisecond=Eq,bq.prototype.visitTimestamp=Dq,bq.prototype.visitTimestampSecond=Dq,bq.prototype.visitTimestampMillisecond=Dq,bq.prototype.visitTimestampMicrosecond=Dq,bq.prototype.visitTimestampNanosecond=Dq,bq.prototype.visitTime=Oq,bq.prototype.visitTimeSecond=Oq,bq.prototype.visitTimeMillisecond=Oq,bq.prototype.visitTimeMicrosecond=Oq,bq.prototype.visitTimeNanosecond=Oq,bq.prototype.visitDecimal=Sq,bq.prototype.visitList=kq,bq.prototype.visitStruct=Aq,bq.prototype.visitUnion=jq,bq.prototype.visitDenseUnion=jq,bq.prototype.visitSparseUnion=jq,bq.prototype.visitDictionary=Mq,bq.prototype.visitInterval=Nq,bq.prototype.visitIntervalDayTime=Nq,bq.prototype.visitIntervalYearMonth=Nq,bq.prototype.visitIntervalMonthDayNano=Nq,bq.prototype.visitDuration=Pq,bq.prototype.visitDurationSecond=Pq,bq.prototype.visitDurationMillisecond=Pq,bq.prototype.visitDurationMicrosecond=Pq,bq.prototype.visitDurationNanosecond=Pq,bq.prototype.visitFixedSizeList=Fq,bq.prototype.visitMap=Iq;const Lq=new bq;function Rq(e,t){return Lq.compareSchemas(e,t)}function zq(e,t){return Lq.compareFields(e,t)}function Bq(e,t){return Lq.visit(e,t)}const Vq=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},LH),oq),xK),rW),BV),sK),MH),hq),{compareSchemas:Rq,compareFields:zq,compareTypes:Bq}),Hq=365.2425,Uq=10**8*24*60*60*1e3,Wq=6048e5,Gq=864e5,Kq=3600,qq=Kq*24,Jq=qq*7,Yq=qq*Hq,Xq=Yq/12,Zq=Xq*3,Qq=Symbol.for(`constructDateFrom`);function $q(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Qq in e?e[Qq](t):e instanceof Date?new e.constructor(t):new Date(t)}function eJ(e,t){return $q(t||e,e)}let tJ={};function nJ(){return tJ}function rJ(e,t){var n,r;let i=nJ(),a=t?.weekStartsOn??(t==null||(n=t.locale)==null||(n=n.options)==null?void 0:n.weekStartsOn)??i.weekStartsOn??((r=i.locale)==null||(r=r.options)==null?void 0:r.weekStartsOn)??0,o=eJ(e,t?.in),s=o.getDay(),c=(s=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function oJ(e){let t=eJ(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function sJ(e,...t){let n=$q.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function cJ(e,t){let n=eJ(e,t?.in);return n.setHours(0,0,0,0),n}function lJ(e,t,n){let[r,i]=sJ(n?.in,e,t),a=cJ(r),o=cJ(i),s=+a-oJ(a),c=+o-oJ(o);return Math.round((s-c)/Gq)}function uJ(e,t){let n=aJ(e,t),r=$q(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),iJ(r)}function dJ(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function fJ(e){return!(!dJ(e)&&typeof e!=`number`||isNaN(+eJ(e)))}function pJ(e,t){let n=eJ(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const mJ={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`}},hJ=(e,t,n)=>{let r,i=mJ[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function gJ(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}const _J={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},vJ={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},yJ={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},bJ={date:gJ({formats:_J,defaultWidth:`full`}),time:gJ({formats:vJ,defaultWidth:`full`}),dateTime:gJ({formats:yJ,defaultWidth:`full`})},xJ={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},SJ=(e,t,n,r)=>xJ[e];function CJ(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const wJ={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},TJ={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},EJ={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`]},DJ={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`]},OJ={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`}},kJ={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`}},AJ=(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},jJ={ordinalNumber:AJ,era:CJ({values:wJ,defaultWidth:`wide`}),quarter:CJ({values:TJ,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:CJ({values:EJ,defaultWidth:`wide`}),day:CJ({values:DJ,defaultWidth:`wide`}),dayPeriod:CJ({values:OJ,defaultWidth:`wide`,formattingValues:kJ,defaultFormattingWidth:`wide`})};function MJ(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?PJ(s,e=>e.test(o)):NJ(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function NJ(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function PJ(e,t){for(let n=0;n{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const IJ=/^(\d+)(th|st|nd|rd)?/i,LJ=/\d+/i,RJ={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},zJ={any:[/^b/i,/^(a|c)/i]},BJ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},VJ={any:[/1/i,/2/i,/3/i,/4/i]},HJ={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},UJ={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]},WJ={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},GJ={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]},KJ={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},qJ={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}},JJ={ordinalNumber:FJ({matchPattern:IJ,parsePattern:LJ,valueCallback:e=>parseInt(e,10)}),era:MJ({matchPatterns:RJ,defaultMatchWidth:`wide`,parsePatterns:zJ,defaultParseWidth:`any`}),quarter:MJ({matchPatterns:BJ,defaultMatchWidth:`wide`,parsePatterns:VJ,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:MJ({matchPatterns:HJ,defaultMatchWidth:`wide`,parsePatterns:UJ,defaultParseWidth:`any`}),day:MJ({matchPatterns:WJ,defaultMatchWidth:`wide`,parsePatterns:GJ,defaultParseWidth:`any`}),dayPeriod:MJ({matchPatterns:KJ,defaultMatchWidth:`any`,parsePatterns:qJ,defaultParseWidth:`any`})},YJ={code:`en-US`,formatDistance:hJ,formatLong:bJ,formatRelative:SJ,localize:jJ,match:JJ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function XJ(e,t){let n=eJ(e,t?.in),r=lJ(n,pJ(n)),i=r+1;return i}function ZJ(e,t){let n=eJ(e,t?.in),r=iJ(n)-+uJ(n);return Math.round(r/Wq)+1}function QJ(e,t){var n,r;let i=eJ(e,t?.in),a=i.getFullYear(),o=nJ(),s=t?.firstWeekContainsDate??(t==null||(n=t.locale)==null||(n=n.options)==null?void 0:n.firstWeekContainsDate)??o.firstWeekContainsDate??((r=o.locale)==null||(r=r.options)==null?void 0:r.firstWeekContainsDate)??1,c=$q(t?.in||e,0);c.setFullYear(a+1,0,s),c.setHours(0,0,0,0);let l=rJ(c,t),u=$q(t?.in||e,0);u.setFullYear(a,0,s),u.setHours(0,0,0,0);let d=rJ(u,t);return+i>=+l?a+1:+i>=+d?a:a-1}function $J(e,t){var n,r;let i=nJ(),a=t?.firstWeekContainsDate??(t==null||(n=t.locale)==null||(n=n.options)==null?void 0:n.firstWeekContainsDate)??i.firstWeekContainsDate??((r=i.locale)==null||(r=r.options)==null?void 0:r.firstWeekContainsDate)??1,o=QJ(e,t),s=$q(t?.in||e,0);s.setFullYear(o,0,a),s.setHours(0,0,0,0);let c=rJ(s,t);return c}function eY(e,t){let n=eJ(e,t?.in),r=rJ(n,t)-+$J(n,t);return Math.round(r/Wq)+1}function tY(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString().padStart(t,`0`);return n+r}const nY={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return tY(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):tY(n+1,2)},d(e,t){return tY(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];case`aaaa`:default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return tY(e.getHours()%12||12,t.length)},H(e,t){return tY(e.getHours(),t.length)},m(e,t){return tY(e.getMinutes(),t.length)},s(e,t){return tY(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*10**(n-3));return tY(i,t.length)}},rY={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},iY={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});case`GGGG`:default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return nY.y(e,t)},Y:function(e,t,n,r){let i=QJ(e,r),a=i>0?i:1-i;if(t===`YY`){let e=a%100;return tY(e,2)}return t===`Yo`?n.ordinalNumber(a,{unit:`year`}):tY(a,t.length)},R:function(e,t){let n=aJ(e);return tY(n,t.length)},u:function(e,t){let n=e.getFullYear();return tY(n,t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return tY(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return tY(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return nY.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return tY(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=eY(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):tY(i,t.length)},I:function(e,t,n){let r=ZJ(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):tY(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):nY.d(e,t)},D:function(e,t,n){let r=XJ(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):tY(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});case`EEEE`:default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return tY(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});case`eeee`:default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return tY(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});case`cccc`:default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return tY(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});case`iiii`:default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours(),i=r/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?rY.noon:r===0?rY.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?rY.evening:r>=12?rY.afternoon:r>=4?rY.morning:rY.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return nY.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):nY.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):tY(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):tY(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):nY.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):nY.s(e,t)},S:function(e,t){return nY.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return oY(r);case`XXXX`:case`XX`:return sY(r);case`XXXXX`:case`XXX`:default:return sY(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return oY(r);case`xxxx`:case`xx`:return sY(r);case`xxxxx`:case`xxx`:default:return sY(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+aY(r,`:`);case`OOOO`:default:return`GMT`+sY(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+aY(r,`:`);case`zzzz`:default:return`GMT`+sY(r,`:`)}},t:function(e,t,n){let r=Math.trunc(e/1e3);return tY(r,t.length)},T:function(e,t,n){return tY(+e,t.length)}};function aY(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+tY(a,2)}function oY(e,t){if(e%60==0){let t=e>0?`-`:`+`;return t+tY(Math.abs(e)/60,2)}return sY(e,t)}function sY(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=tY(Math.trunc(r/60),2),a=tY(r%60,2);return n+i+t+a}const cY=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});case`PPPP`:default:return t.date({width:`full`})}},lY=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});case`pppp`:default:return t.time({width:`full`})}},uY=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return cY(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;case`PPPP`:default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,cY(r,t)).replace(`{{time}}`,lY(i,t))},dY={p:lY,P:uY},fY=/^D+$/,pY=/^Y+$/,mY=[`D`,`DD`,`YY`,`YYYY`];function hY(e){return fY.test(e)}function gY(e){return pY.test(e)}function _Y(e,t,n){let r=vY(e,t,n);if(console.warn(r),mY.includes(e))throw RangeError(r)}function vY(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const yY=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bY=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xY=/^'([^]*?)'?$/,SY=/''/g,CY=/[a-zA-Z]/;function wY(e,t,n){var r,i,a,o;let s=nJ(),c=n?.locale??s.locale??YJ,l=n?.firstWeekContainsDate??(n==null||(r=n.locale)==null||(r=r.options)==null?void 0:r.firstWeekContainsDate)??s.firstWeekContainsDate??((i=s.locale)==null||(i=i.options)==null?void 0:i.firstWeekContainsDate)??1,u=n?.weekStartsOn??(n==null||(a=n.locale)==null||(a=a.options)==null?void 0:a.weekStartsOn)??s.weekStartsOn??((o=s.locale)==null||(o=o.options)==null?void 0:o.weekStartsOn)??0,d=eJ(e,n?.in);if(!fJ(d))throw RangeError(`Invalid time value`);let f=t.match(bY).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=dY[t];return n(e,c.formatLong)}return e}).join(``).match(yY).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:TY(e)};if(iY[t])return{isToken:!0,value:e};if(t.match(CY))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});c.localize.preprocessor&&(f=c.localize.preprocessor(d,f));let p={firstWeekContainsDate:l,weekStartsOn:u,locale:c};return f.map(r=>{if(!r.isToken)return r.value;let i=r.value;(!n?.useAdditionalWeekYearTokens&&gY(i)||!n?.useAdditionalDayOfYearTokens&&hY(i))&&_Y(i,t,String(e));let a=iY[i[0]];return a(d,i,c.localize,p)}).join(``)}function TY(e){let t=e.match(xY);return t?t[1].replace(SY,`'`):e}function EY(e,t){return eJ(e*1e3,t?.in)}function DY(e,t){let n=OY(t)?new t(0):$q(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function OY(e){var t;return typeof e==`function`&&(t=e.prototype)?.constructor===e}function kY(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function AY(e){return e==null}function jY(e){return e!=null}async function MY(){if(typeof window<`u`&&window!==null)return`browser`;try{let e=await Et(()=>import(`./__vite-browser-external-CubORAmj.js`).then(wt(1)),__vite__mapDeps([0,1,2,3]));return e!==void 0&&e.versions!=null&&e.versions.node!=null?`node`:`unknown`}catch{return`unknown`}}function NY(e){return AY(e)?!1:vU.isInt(e.type)&&!zY(e)||PY(e)}function PY(e){return AY(e)?!1:vU.isInt(e.type)&&e.type.isSigned===!1}function FY(e){return AY(e)?!1:vU.isFloat(e.type)??!1}function IY(e){return AY(e)?!1:vU.isDecimal(e.type)}function LY(e){return AY(e)?!1:vU.isBool(e.type)}function RY(e){return AY(e)?!1:vU.isDuration(e.type)}function zY(e){return AY(e)?!1:vU.isInt(e.type)&&e.metadata.get(`ARROW:extension:name`)===`period`}function BY(e){return AY(e)?!1:vU.isTimestamp(e.type)}function VY(e){return AY(e)?!1:vU.isDate(e.type)}function HY(e){return AY(e)?!1:vU.isTime(e.type)}function UY(e){return AY(e)?!1:vU.isList(e.type)||vU.isFixedSizeList(e.type)}function WY(e){return AY(e)?!1:vU.isStruct(e.type)||vU.isMap(e.type)}function GY(e){return AY(e)?!1:vU.isStruct(e.type)&&e.metadata.get(`ARROW:extension:name`)===`interval`||vU.isInterval(e.type)}const KY=new Date(1970,0,1);function qY(e,t){let n;if(t===kH.MILLISECOND)n=1e3;else if(t===kH.MICROSECOND)n=1e3*1e3;else if(t===kH.NANOSECOND)n=1e3*1e3*1e3;else return Number(e);return typeof e==`bigint`&&!Number.isSafeInteger(Number(e))?Number(e/BigInt(n)):Number(e)/n}function JY(e,t){var n;let r=qY(e,(t==null||(n=t.type)==null?void 0:n.unit)??kH.SECOND);return EY(r)}function YY(e,t){let n=JY(e,t);return wY(n,n.getMilliseconds()===0?`HH:mm:ss`:`HH:mm:ss.SSS`)}function XY(e){let t=`yyyy-MM-dd`;return e instanceof Date||typeof e==`number`&&Number.isFinite(e)?wY(e,t):(console.warn(`Unsupported date value: ${e}`),String(e))}function ZY(e,t){var n;if(!(e instanceof Date||typeof e==`number`&&Number.isFinite(e)))return console.warn(`Unsupported datetime value: ${e}`),null;let r,i=t==null||(n=t.type)==null?void 0:n.timezone;return r=i?new SV(e,i):new SV(e),DY(r,Date)}function QY(e,t){var n;let r=(t==null||(n=t.type)==null?void 0:n.scale)||0,i=Vq.bigNumToString(new Vq.BN(e)).padStart(r,`0`);if(r===0)return i;let a=``;i.startsWith(`-`)&&(a=`-`,i=i.slice(1));let o=i.slice(0,-r)||`0`,s=kY(i.slice(-r),`0`)||``;return`${a}${o}${s?`.${s}`:``}`}const $Y=new Intl.NumberFormat(`en-US`,{style:`decimal`,maximumFractionDigits:4,minimumFractionDigits:4,useGrouping:!0});function eX(e){let t=e[0],n=e[1],r=[];return t!==0&&r.push(`${t} year${t>1?`s`:``}`),n!==0&&r.push(`${n} month${n>1?`s`:``}`),r.length?r.join(` `):`0 months`}function tX(e,t){if(vU.isInterval(t?.type))return eX(e);let n=t&&t.metadata.get(`ARROW:extension:name`);if(n&&n===`pandas.interval`){var r,i;let n=JSON.parse(t.metadata.get(`ARROW:extension:metadata`)),{closed:a}=n,o=e.toJSON(),s=a===`both`||a===`left`?`[`:`(`,c=a===`both`||a===`right`?`]`:`)`,l=rX(o.left,(r=t.type)==null||(r=r.children)==null?void 0:r[0]),u=rX(o.right,(i=t.type)==null||(i=i.children)==null?void 0:i[1]);return`${s+l}, ${u+c}`}return String(e)}function nX(e,t){return t?.type instanceof GU?JSON.parse(JSON.stringify(e,(e,t)=>{if(jY(t))return typeof t==`bigint`?Number(t):t})):JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t))}function rX(e,t){if(AY(e))return null;let n=e instanceof Date||Number.isFinite(e);if(n&&VY(t))return XY(e);if(typeof e==`bigint`&&HY(t))return YY(Number(e),t);if(n&&BY(t))return ZY(e,t);if(zY(t))throw Error(`Period type is not supported yet`);if(GY(t))return tX(e,t);if(RY(t))throw Error(`Duration type is not supported yet`);return IY(t)?QY(e,t):FY(t)&&Number.isFinite(e)||NY(t)?e:WY(t)||UY(t)?nX(e,t):LY(t)?!!e:String(e)}function iX(e){let t=(e.toArray()||[]).map(e=>e.toJSON())||[],n=t.map(t=>(e.schema.fields.forEach(e=>t[e.name]=rX(t[e.name],e)),t));return n}let aX=function(e){return e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e}({});async function oX(e){let t=Nt(e,{logger:!1}),n,r,i=await MY();if(i===`browser`){if(t.bundles===void 0){let{getBundles:e}=await Et(async()=>{let{getBundles:e}=await import(`./default-browser-DTRWbcB3.js`);return{getBundles:e}},[]);t.bundles=await e()}r=await mV(await t.bundles),n=new Worker(r.mainWorker)}else if(i===`node`){if(t.bundles===void 0){let{getBundles:e}=await Et(async()=>{let{getBundles:e}=await import(`./default-node-G9zSbWb2.js`);return{getBundles:e}},__vite__mapDeps([4,2,3]));t.bundles=await e()}r=await mV(await t.bundles);let e=r.mainWorker;e.startsWith(`/@fs/`)&&(e=e.replace(`/@fs/`,`file://`));let i=await Et(()=>import(`./browser-CMSJHaBF.js`),[]);n=new i.default(e,{type:`module`})}else throw Error(`Unsupported environment: ${i}`);let a;a=t.logger===!0?new MB:t.logger===!1?new jB:t.logger;let o=new UB(a,n);if(await o.instantiate(r.mainModule,r.pthreadWorker),t.storage)switch(t.storage.type){case aX.ORIGIN_PRIVATE_FS:try{let e=t.storage.path;e.startsWith(`/`)&&(e=e.slice(1)),await o.open({path:`opfs://${e}`,accessMode:t.storage.accessMode})}catch(e){throw await o.terminate(),await n.terminate(),e}break;case aX.NODE_FS:try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(e){throw await o.terminate(),await n.terminate(),e}break}let s=await o.connect();async function c(e,t=[]){if(!t||t.length===0){let t=await s.query(e);return{_results:t,_schema:t.schema,columns:t.schema.fields,rows:iX(t)}}let n=await s.prepare(e),r=await n.query(...t);return n.close(),{_results:r,_schema:r.schema,columns:r.schema.fields,rows:iX(r)}}return{worker:n,db:o,conn:s,query:async(e,t=[])=>c(e,t).then(e=>e.rows),queryWithColumns:async(e,t=[])=>c(e,t),close:async()=>{await s.close(),await o.terminate(),await n.terminate()}}}async function sX(e,t){await(await e).conn.send(`BEGIN TRANSACTION`);try{let n=await t(e);return await(await e).conn.send(`COMMIT`),n}catch(t){throw await(await e).conn.send(`ROLLBACK`),t}}async function cX(e,t,n){await(await e).conn.send(`SAVEPOINT ${t}`);try{let r=await n(e);return await(await e).conn.send(`RELEASE SAVEPOINT ${t}`),r}catch(n){throw await(await e).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const Z=Symbol.for(`drizzle:entityKind`),lX=Symbol.for(`drizzle:hasOwnEntityKind`);function Q(e,t){if(!e||typeof e!=`object`)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,Z))throw Error(`Class "${t.name??``}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(Z in n&&n[Z]===t[Z])return!0;n=Object.getPrototypeOf(n)}return!1}var uX=(pr=class{constructor(t,n){e.defineProperty(this,`name`,void 0),e.defineProperty(this,`keyAsName`,void 0),e.defineProperty(this,`primary`,void 0),e.defineProperty(this,`notNull`,void 0),e.defineProperty(this,`default`,void 0),e.defineProperty(this,`defaultFn`,void 0),e.defineProperty(this,`onUpdateFn`,void 0),e.defineProperty(this,`hasDefault`,void 0),e.defineProperty(this,`isUnique`,void 0),e.defineProperty(this,`uniqueName`,void 0),e.defineProperty(this,`uniqueType`,void 0),e.defineProperty(this,`dataType`,void 0),e.defineProperty(this,`columnType`,void 0),e.defineProperty(this,`enumValues`,void 0),e.defineProperty(this,`generated`,void 0),e.defineProperty(this,`generatedIdentity`,void 0),e.defineProperty(this,`config`,void 0),this.table=t,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!==`byDefault`}},e.defineProperty(pr,Z,`Column`),pr),dX=(mr=class{constructor(t,n,r){e.defineProperty(this,`config`,void 0),e.defineProperty(this,`$default`,this.$defaultFn),e.defineProperty(this,`$onUpdate`,this.$onUpdateFn),this.config={name:t,keyAsName:t===``,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===``&&(this.config.name=e)}},e.defineProperty(mr,Z,`ColumnBuilder`),mr);const fX=Symbol.for(`drizzle:Name`);var pX=(hr=class{constructor(t,n){e.defineProperty(this,`reference`,void 0),e.defineProperty(this,`_onUpdate`,`no action`),e.defineProperty(this,`_onDelete`,`no action`),this.reference=()=>{let{name:e,columns:n,foreignColumns:r}=t();return{name:e,columns:n,foreignTable:r[0].table,foreignColumns:r}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(e){return this._onUpdate=e===void 0?`no action`:e,this}onDelete(e){return this._onDelete=e===void 0?`no action`:e,this}build(e){return new mX(e,this)}},e.defineProperty(hr,Z,`PgForeignKeyBuilder`),hr),mX=(gr=class{constructor(t,n){e.defineProperty(this,`reference`,void 0),e.defineProperty(this,`onUpdate`,void 0),e.defineProperty(this,`onDelete`,void 0),this.table=t,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),r=t.map(e=>e.name),i=n.map(e=>e.name),a=[this.table[fX],...r,n[0].table[fX],...i];return e??`${a.join(`_`)}_fk`}},e.defineProperty(gr,Z,`PgForeignKey`),gr);function hX(e,...t){return e(...t)}function gX(e,t){return`${e[fX]}_${t.join(`_`)}_unique`}var _X=(_r=class{constructor(t,n){e.defineProperty(this,`columns`,void 0),e.defineProperty(this,`nullsNotDistinctConfig`,!1),this.name=n,this.columns=t}nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new yX(e,this.columns,this.nullsNotDistinctConfig,this.name)}},e.defineProperty(_r,Z,`PgUniqueConstraintBuilder`),_r),vX=(vr=class{constructor(t){e.defineProperty(this,`name`,void 0),this.name=t}on(...e){return new _X(e,this.name)}},e.defineProperty(vr,Z,`PgUniqueOnConstraintBuilder`),vr),yX=(yr=class{constructor(t,n,r,i){e.defineProperty(this,`columns`,void 0),e.defineProperty(this,`name`,void 0),e.defineProperty(this,`nullsNotDistinct`,!1),this.table=t,this.columns=n,this.name=i??gX(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=r}getName(){return this.name}},e.defineProperty(yr,Z,`PgUniqueConstraint`),yr);function bX(e,t,n){for(let r=t;rArray.isArray(e)?CX(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var wX=(br=class extends dX{constructor(...t){super(...t),e.defineProperty(this,`foreignKeyConfigs`,[])}array(e){return new OX(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:`always`,mode:`stored`},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:r})=>hX((n,r)=>{let i=new pX(()=>{let t=n();return{columns:[e],foreignColumns:[t]}});return r.onUpdate&&i.onUpdate(r.onUpdate),r.onDelete&&i.onDelete(r.onDelete),i.build(t)},n,r))}buildExtraConfigColumn(e){return new EX(e,this.config)}},e.defineProperty(br,Z,`PgColumnBuilder`),br),TX=(xr=class extends uX{constructor(e,t){t.uniqueName||=gX(e,[t.name]),super(e,t),this.table=e}},e.defineProperty(xr,Z,`PgColumn`),xr),EX=(Sr=class extends TX{constructor(...t){super(...t),e.defineProperty(this,`indexConfig`,{order:this.config.order??`asc`,nulls:this.config.nulls??`last`,opClass:this.config.opClass}),e.defineProperty(this,`defaultConfig`,{order:`asc`,nulls:`last`,opClass:void 0})}getSQLType(){return this.getSQLType()}asc(){return this.indexConfig.order=`asc`,this}desc(){return this.indexConfig.order=`desc`,this}nullsFirst(){return this.indexConfig.nulls=`first`,this}nullsLast(){return this.indexConfig.nulls=`last`,this}op(e){return this.indexConfig.opClass=e,this}},e.defineProperty(Sr,Z,`ExtraConfigColumn`),Sr),DX=(Cr=class{constructor(t,n,r,i){e.defineProperty(this,`name`,void 0),e.defineProperty(this,`keyAsName`,void 0),e.defineProperty(this,`type`,void 0),e.defineProperty(this,`indexConfig`,void 0),this.name=t,this.keyAsName=n,this.type=r,this.indexConfig=i}},e.defineProperty(Cr,Z,`IndexedColumn`),Cr),OX=(wr=class extends wX{constructor(e,t,n){super(e,`array`,`PgArray`),this.config.baseBuilder=t,this.config.size=n}build(e){let t=this.config.baseBuilder.build(e);return new kX(e,this.config,t)}},e.defineProperty(wr,Z,`PgArrayBuilder`),wr),kX=(Tr=class t extends TX{constructor(t,n,r,i){super(t,n),e.defineProperty(this,`size`,void 0),this.baseColumn=r,this.range=i,this.size=n.size}getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==`number`?this.size:``}]`}mapFromDriverValue(e){return typeof e==`string`&&(e=SX(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(e,n=!1){let r=e.map(e=>e===null?null:Q(this.baseColumn,t)?this.baseColumn.mapToDriverValue(e,!0):this.baseColumn.mapToDriverValue(e));return n?r:CX(r)}},e.defineProperty(Tr,Z,`PgArray`),Tr),AX=(Er=class extends wX{constructor(e,t){super(e,`string`,`PgEnumObjectColumn`),this.config.enum=t}build(e){return new jX(e,this.config)}},e.defineProperty(Er,Z,`PgEnumObjectColumnBuilder`),Er),jX=(Dr=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`enum`,void 0),e.defineProperty(this,`enumValues`,this.config.enum.enumValues),this.enum=n.enum}getSQLType(){return this.enum.enumName}},e.defineProperty(Dr,Z,`PgEnumObjectColumn`),Dr);const MX=Symbol.for(`drizzle:isPgEnum`);function NX(e){return!!e&&typeof e==`function`&&MX in e&&e[MX]===!0}var PX=(Or=class extends wX{constructor(e,t){super(e,`string`,`PgEnumColumn`),this.config.enum=t}build(e){return new FX(e,this.config)}},e.defineProperty(Or,Z,`PgEnumColumnBuilder`),Or),FX=(kr=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`enum`,this.config.enum),e.defineProperty(this,`enumValues`,this.config.enum.enumValues),this.enum=n.enum}getSQLType(){return this.enum.enumName}},e.defineProperty(kr,Z,`PgEnumColumn`),kr),IX=(Ar=class{constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},e.defineProperty(Ar,Z,`Subquery`),Ar),LX=(jr=class extends IX{},e.defineProperty(jr,Z,`WithSubquery`),jr),RX=`0.44.2`;let zX,BX;const VX={startActiveSpan(e,t){return zX?(BX||=zX.trace.getTracer(`drizzle-orm`,RX),hX((n,r)=>r.startActiveSpan(e,e=>{try{return t(e)}catch(t){throw e.setStatus({code:n.SpanStatusCode.ERROR,message:t instanceof Error?t.message:`Unknown error`}),t}finally{e.end()}}),zX,BX)):t()}},HX=Symbol.for(`drizzle:ViewBaseConfig`),UX=Symbol.for(`drizzle:Schema`),WX=Symbol.for(`drizzle:Columns`),GX=Symbol.for(`drizzle:ExtraConfigColumns`),KX=Symbol.for(`drizzle:OriginalName`),qX=Symbol.for(`drizzle:BaseName`),JX=Symbol.for(`drizzle:IsAlias`),YX=Symbol.for(`drizzle:ExtraConfigBuilder`),XX=Symbol.for(`drizzle:IsDrizzleTable`);var ZX=(Mr=class{constructor(t,n,r){e.defineProperty(this,fX,void 0),e.defineProperty(this,KX,void 0),e.defineProperty(this,UX,void 0),e.defineProperty(this,WX,void 0),e.defineProperty(this,GX,void 0),e.defineProperty(this,qX,void 0),e.defineProperty(this,JX,!1),e.defineProperty(this,XX,!0),e.defineProperty(this,YX,void 0),this[fX]=this[KX]=t,this[UX]=n,this[qX]=r}},e.defineProperty(Mr,Z,`Table`),e.defineProperty(Mr,`Symbol`,{Name:fX,Schema:UX,OriginalName:KX,Columns:WX,ExtraConfigColumns:GX,BaseName:qX,IsAlias:JX,ExtraConfigBuilder:YX}),Mr);function QX(e){return e[fX]}function $X(e){return`${e[UX]??`public`}.${e[fX]}`}var eZ=(Nr=class{},e.defineProperty(Nr,Z,`FakePrimitiveParam`),Nr);function tZ(e){return e!=null&&typeof e.getSQL==`function`}function nZ(e){let t={sql:``,params:[]};for(let r of e){var n;t.sql+=r.sql,t.params.push(...r.params),(n=r.typings)?.length&&(t.typings||=[],t.typings.push(...r.typings))}return t}var rZ=(Pr=class{constructor(t){e.defineProperty(this,`value`,void 0),this.value=Array.isArray(t)?t:[t]}getSQL(){return new iZ([this])}},e.defineProperty(Pr,Z,`StringChunk`),Pr),iZ=(Fr=class t{constructor(t){e.defineProperty(this,`decoder`,sZ),e.defineProperty(this,`shouldInlineParams`,!1),e.defineProperty(this,`usedTables`,[]),this.queryChunks=t;for(let e of t)if(Q(e,ZX)){let t=e[ZX.Symbol.Schema];this.usedTables.push(t===void 0?e[ZX.Symbol.Name]:t+`.`+e[ZX.Symbol.Name])}}append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return VX.startActiveSpan(`drizzle.buildSQL`,t=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(e,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:i,escapeName:a,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:l}=r;return nZ(e.map(e=>{if(Q(e,rZ))return{sql:e.value.join(``),params:[]};if(Q(e,aZ))return{sql:a(e.value),params:[]};if(e===void 0)return{sql:``,params:[]};if(Array.isArray(e)){let t=[new rZ(`(`)];for(let[n,r]of e.entries())t.push(r),ne},cZ={mapToDriverValue:e=>e},lZ={...sZ,...cZ};var uZ=(Lr=class{constructor(t,n=cZ){e.defineProperty(this,`brand`,void 0),this.value=t,this.encoder=n}getSQL(){return new iZ([this])}},e.defineProperty(Lr,Z,`Param`),Lr);function $(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new rZ(e[0]));for(let[r,i]of t.entries())n.push(i,new rZ(e[r+1]));return new iZ(n)}(e=>{function t(){return new iZ([])}e.empty=t;function n(e){return new iZ(e)}e.fromList=n;function r(e){return new iZ([new rZ(e)])}e.raw=r;function i(e,t){let n=[];for(let[r,i]of e.entries())r>0&&t!==void 0&&n.push(t),n.push(i);return new iZ(n)}e.join=i;function a(e){return new aZ(e)}e.identifier=a;function o(e){return new dZ(e)}e.placeholder=o;function s(e,t){return new uZ(e,t)}e.param=s})($||={}),(t=>{class n{constructor(t,n){e.defineProperty(this,`isSelectionField`,!1),this.sql=t,this.fieldAlias=n}getSQL(){return this.sql}clone(){return new n(this.sql,this.fieldAlias)}}e.defineProperty(n,Z,`SQL.Aliased`),t.Aliased=n})(iZ||={});var dZ=(Rr=class{constructor(e){this.name=e}getSQL(){return new iZ([this])}},e.defineProperty(Rr,Z,`Placeholder`),Rr);function fZ(e,t){return e.map(e=>{if(Q(e,dZ)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(Q(e,uZ)&&Q(e.value,dZ)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const pZ=Symbol.for(`drizzle:IsDrizzleView`);var mZ=(zr=class{constructor({name:t,schema:n,selectedFields:r,query:i}){e.defineProperty(this,HX,void 0),e.defineProperty(this,pZ,!0),this[HX]={name:t,originalName:t,schema:n,selectedFields:r,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new iZ([this])}},e.defineProperty(zr,Z,`View`),zr);uX.prototype.getSQL=function(){return new iZ([this])},ZX.prototype.getSQL=function(){return new iZ([this])},IX.prototype.getSQL=function(){return new iZ([this])};var hZ=(Br=class{constructor(e){this.table=e}get(e,t){return t===`table`?this.table:e[t]}},e.defineProperty(Br,Z,`ColumnAliasProxyHandler`),Br),gZ=(Vr=class{constructor(e,t){this.alias=e,this.replaceOriginalName=t}get(e,t){if(t===ZX.Symbol.IsAlias)return!0;if(t===ZX.Symbol.Name||this.replaceOriginalName&&t===ZX.Symbol.OriginalName)return this.alias;if(t===HX)return{...e[HX],name:this.alias,isAlias:!0};if(t===ZX.Symbol.Columns){let t=e[ZX.Symbol.Columns];if(!t)return t;let n={};return Object.keys(t).map(r=>{n[r]=new Proxy(t[r],new hZ(new Proxy(e,this)))}),n}let n=e[t];return Q(n,uX)?new Proxy(n,new hZ(new Proxy(e,this))):n}},e.defineProperty(Vr,Z,`TableAliasProxyHandler`),Vr),_Z=(Hr=class{constructor(e){this.alias=e}get(e,t){return t===`sourceTable`?vZ(e.sourceTable,this.alias):e[t]}},e.defineProperty(Hr,Z,`RelationTableAliasProxyHandler`),Hr);function vZ(e,t){return new Proxy(e,new gZ(t,!1))}function yZ(e,t){return new Proxy(e,new hZ(new Proxy(e.table,new gZ(t,!1))))}function bZ(e,t){return new iZ.Aliased(xZ(e.sql,t),e.fieldAlias)}function xZ(e,t){return $.join(e.queryChunks.map(e=>Q(e,uX)?yZ(e,t):Q(e,iZ)?xZ(e,t):Q(e,iZ.Aliased)?bZ(e,t):e))}var SZ=(Ur=class extends Error{constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},e.defineProperty(Ur,Z,`DrizzleError`),Ur),CZ=(Wr=class extends SZ{constructor(){super({message:`Rollback`})}},e.defineProperty(Wr,Z,`TransactionRollbackError`),Wr),wZ=(Gr=class{write(e){console.log(e)}},e.defineProperty(Gr,Z,`ConsoleLogWriter`),Gr),TZ=(Kr=class{constructor(t){e.defineProperty(this,`writer`,void 0),this.writer=t?.writer??new wZ}logQuery(e,t){let n=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),r=n.length?` -- params: [${n.join(`, `)}]`:``;this.writer.write(`Query: ${e}${r}`)}},e.defineProperty(Kr,Z,`DefaultLogger`),Kr),EZ=(qr=class{logQuery(){}},e.defineProperty(qr,Z,`NoopLogger`),qr),DZ=(ea=Symbol.toStringTag,Jr=class{constructor(){e.defineProperty(this,ea,`QueryPromise`)}catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}},e.defineProperty(Jr,Z,`QueryPromise`),Jr);function OZ(e,t){return Object.entries(e).reduce((e,[n,r])=>{if(typeof n!=`string`)return e;let i=t?[...t,n]:[n];return Q(r,uX)||Q(r,iZ)||Q(r,iZ.Aliased)?e.push({path:i,field:r}):Q(r,ZX)?e.push(...OZ(r[ZX.Symbol.Columns],i)):e.push(...OZ(r,i)),e},[])}function kZ(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let[e,t]of n.entries())if(t!==r[e])return!1;return!0}function AZ(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>Q(n,iZ)||Q(n,uX)?[t,n]:[t,new uZ(n,e[ZX.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function jZ(e,t){for(let n of t)for(let t of Object.getOwnPropertyNames(n.prototype)){if(t===`constructor`)continue;Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(n.prototype,t)||Object.create(null))}}function MZ(e){return e[ZX.Symbol.Columns]}function NZ(e){return Q(e,IX)?e._.alias:Q(e,mZ)?e[HX].name:Q(e,iZ)?void 0:e[ZX.Symbol.IsAlias]?e[ZX.Symbol.Name]:e[ZX.Symbol.BaseName]}function PZ(e){if(typeof e!=`object`||!e||e.constructor.name!==`Object`)return!1;if(`logger`in e){let t=typeof e.logger;return!(t!==`boolean`&&(t!==`object`||typeof e.logger.logQuery!=`function`)&&t!==`undefined`)}if(`schema`in e){let t=typeof e.schema;return!(t!==`object`&&t!==`undefined`)}if(`casing`in e){let t=typeof e.casing;return!(t!==`string`&&t!==`undefined`)}if(`mode`in e)return!(e.mode!==`default`||e.mode!==`planetscale`||e.mode!==void 0);if(`connection`in e){let t=typeof e.connection;return!(t!==`string`&&t!==`object`&&t!==`undefined`)}if(`client`in e){let t=typeof e.client;return!(t!==`object`&&t!==`function`&&t!==`undefined`)}return Object.keys(e).length===0}var FZ=(Yr=class extends wX{defaultNow(){return this.default($`now()`)}},e.defineProperty(Yr,Z,`PgDateColumnBaseBuilder`),Yr),IZ=(Xr=class extends FZ{constructor(e){super(e,`date`,`PgDate`)}build(e){return new LZ(e,this.config)}},e.defineProperty(Xr,Z,`PgDateBuilder`),Xr),LZ=(Zr=class extends TX{getSQLType(){return`date`}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},e.defineProperty(Zr,Z,`PgDate`),Zr),RZ=(Qr=class extends FZ{constructor(e){super(e,`string`,`PgDateString`)}build(e){return new zZ(e,this.config)}},e.defineProperty(Qr,Z,`PgDateStringBuilder`),Qr),zZ=($r=class extends TX{getSQLType(){return`date`}},e.defineProperty($r,Z,`PgDateString`),$r),BZ=(ei=class extends wX{constructor(e){super(e,`json`,`PgJson`)}build(e){return new VZ(e,this.config)}},e.defineProperty(ei,Z,`PgJsonBuilder`),ei),VZ=(ti=class extends TX{constructor(e,t){super(e,t)}getSQLType(){return`json`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},e.defineProperty(ti,Z,`PgJson`),ti),HZ=(ni=class extends wX{constructor(e){super(e,`json`,`PgJsonb`)}build(e){return new UZ(e,this.config)}},e.defineProperty(ni,Z,`PgJsonbBuilder`),ni),UZ=(ri=class extends TX{constructor(e,t){super(e,t)}getSQLType(){return`jsonb`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},e.defineProperty(ri,Z,`PgJsonb`),ri),WZ=(ii=class extends wX{constructor(e,t,n){super(e,`string`,`PgNumeric`),this.config.precision=t,this.config.scale=n}build(e){return new GZ(e,this.config)}},e.defineProperty(ii,Z,`PgNumericBuilder`),ii),GZ=(ai=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`precision`,void 0),e.defineProperty(this,`scale`,void 0),this.precision=n.precision,this.scale=n.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})`}},e.defineProperty(ai,Z,`PgNumeric`),ai),KZ=(oi=class extends wX{constructor(e,t,n){super(e,`number`,`PgNumericNumber`),this.config.precision=t,this.config.scale=n}build(e){return new qZ(e,this.config)}},e.defineProperty(oi,Z,`PgNumericNumberBuilder`),oi),qZ=(si=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`precision`,void 0),e.defineProperty(this,`scale`,void 0),e.defineProperty(this,`mapToDriverValue`,String),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},e.defineProperty(si,Z,`PgNumericNumber`),si),JZ=(ci=class extends wX{constructor(e,t,n){super(e,`bigint`,`PgNumericBigInt`),this.config.precision=t,this.config.scale=n}build(e){return new YZ(e,this.config)}},e.defineProperty(ci,Z,`PgNumericBigIntBuilder`),ci),YZ=(li=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`precision`,void 0),e.defineProperty(this,`scale`,void 0),e.defineProperty(this,`mapFromDriverValue`,BigInt),e.defineProperty(this,`mapToDriverValue`,String),this.precision=n.precision,this.scale=n.scale}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},e.defineProperty(li,Z,`PgNumericBigInt`),li),XZ=(ui=class extends FZ{constructor(e,t,n){super(e,`string`,`PgTime`),this.withTimezone=t,this.precision=n,this.config.withTimezone=t,this.config.precision=n}build(e){return new ZZ(e,this.config)}},e.defineProperty(ui,Z,`PgTimeBuilder`),ui),ZZ=(di=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`withTimezone`,void 0),e.defineProperty(this,`precision`,void 0),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`time${e}${this.withTimezone?` with time zone`:``}`}},e.defineProperty(di,Z,`PgTime`),di),QZ=(fi=class extends FZ{constructor(e,t,n){super(e,`date`,`PgTimestamp`),this.config.withTimezone=t,this.config.precision=n}build(e){return new $Z(e,this.config)}},e.defineProperty(fi,Z,`PgTimestampBuilder`),fi),$Z=(pi=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`withTimezone`,void 0),e.defineProperty(this,`precision`,void 0),e.defineProperty(this,`mapFromDriverValue`,e=>new Date(this.withTimezone?e:e+`+0000`)),e.defineProperty(this,`mapToDriverValue`,e=>e.toISOString()),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){let e=this.precision===void 0?``:` (${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}},e.defineProperty(pi,Z,`PgTimestamp`),pi),eQ=(mi=class extends FZ{constructor(e,t,n){super(e,`string`,`PgTimestampString`),this.config.withTimezone=t,this.config.precision=n}build(e){return new tQ(e,this.config)}},e.defineProperty(mi,Z,`PgTimestampStringBuilder`),mi),tQ=(hi=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`withTimezone`,void 0),e.defineProperty(this,`precision`,void 0),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}},e.defineProperty(hi,Z,`PgTimestampString`),hi),nQ=(gi=class extends wX{constructor(e){super(e,`string`,`PgUUID`)}defaultRandom(){return this.default($`gen_random_uuid()`)}build(e){return new rQ(e,this.config)}},e.defineProperty(gi,Z,`PgUUIDBuilder`),gi),rQ=(_i=class extends TX{getSQLType(){return`uuid`}},e.defineProperty(_i,Z,`PgUUID`),_i);const iQ=Symbol.for(`drizzle:PgInlineForeignKeys`),aQ=Symbol.for(`drizzle:EnableRLS`);var oQ=(ta=ZX.Symbol.ExtraConfigBuilder,na=ZX.Symbol.ExtraConfigColumns,vi=class extends ZX{constructor(...t){super(...t),e.defineProperty(this,iQ,[]),e.defineProperty(this,aQ,!1),e.defineProperty(this,ta,void 0),e.defineProperty(this,na,{})}},e.defineProperty(vi,Z,`PgTable`),e.defineProperty(vi,`Symbol`,Object.assign({},ZX.Symbol,{InlineForeignKeys:iQ,EnableRLS:aQ})),vi),sQ=(yi=class{constructor(t,n){e.defineProperty(this,`columns`,void 0),e.defineProperty(this,`name`,void 0),this.columns=t,this.name=n}build(e){return new cQ(e,this.columns,this.name)}},e.defineProperty(yi,Z,`PgPrimaryKeyBuilder`),yi),cQ=(bi=class{constructor(t,n,r){e.defineProperty(this,`columns`,void 0),e.defineProperty(this,`name`,void 0),this.table=t,this.columns=n,this.name=r}getName(){return this.name??`${this.table[oQ.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}},e.defineProperty(bi,Z,`PgPrimaryKey`),bi);function lQ(e,t){return oZ(t)&&!tZ(e)&&!Q(e,uZ)&&!Q(e,dZ)&&!Q(e,uX)&&!Q(e,ZX)&&!Q(e,mZ)?new uZ(e,t):e}const uQ=(e,t)=>$`${e} = ${lQ(t,e)}`,dQ=(e,t)=>$`${e} <> ${lQ(t,e)}`;function fQ(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new iZ(t):new iZ([new rZ(`(`),$.join(t,new rZ(` and `)),new rZ(`)`)])}function pQ(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new iZ(t):new iZ([new rZ(`(`),$.join(t,new rZ(` or `)),new rZ(`)`)])}function mQ(e){return $`not ${e}`}const hQ=(e,t)=>$`${e} > ${lQ(t,e)}`,gQ=(e,t)=>$`${e} >= ${lQ(t,e)}`,_Q=(e,t)=>$`${e} < ${lQ(t,e)}`,vQ=(e,t)=>$`${e} <= ${lQ(t,e)}`;function yQ(e,t){return Array.isArray(t)?t.length===0?$`false`:$`${e} in ${t.map(t=>lQ(t,e))}`:$`${e} in ${lQ(t,e)}`}function bQ(e,t){return Array.isArray(t)?t.length===0?$`true`:$`${e} not in ${t.map(t=>lQ(t,e))}`:$`${e} not in ${lQ(t,e)}`}function xQ(e){return $`${e} is null`}function SQ(e){return $`${e} is not null`}function CQ(e){return $`exists ${e}`}function wQ(e){return $`not exists ${e}`}function TQ(e,t,n){return $`${e} between ${lQ(t,e)} and ${lQ(n,e)}`}function EQ(e,t,n){return $`${e} not between ${lQ(t,e)} and ${lQ(n,e)}`}function DQ(e,t){return $`${e} like ${t}`}function OQ(e,t){return $`${e} not like ${t}`}function kQ(e,t){return $`${e} ilike ${t}`}function AQ(e,t){return $`${e} not ilike ${t}`}function jQ(e){return $`${e} asc`}function MQ(e){return $`${e} desc`}var NQ=(xi=class{constructor(t,n,r){e.defineProperty(this,`referencedTableName`,void 0),e.defineProperty(this,`fieldName`,void 0),this.sourceTable=t,this.referencedTable=n,this.relationName=r,this.referencedTableName=n[ZX.Symbol.Name]}},e.defineProperty(xi,Z,`Relation`),xi),PQ=(Si=class{constructor(e,t){this.table=e,this.config=t}},e.defineProperty(Si,Z,`Relations`),Si),FQ=(Ci=class e extends NQ{constructor(e,t,n,r){super(e,t,n?.relationName),this.config=n,this.isNullable=r}withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config,this.isNullable);return n.fieldName=t,n}},e.defineProperty(Ci,Z,`One`),Ci),IQ=(wi=class e extends NQ{constructor(e,t,n){super(e,t,n?.relationName),this.config=n}withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config);return n.fieldName=t,n}},e.defineProperty(wi,Z,`Many`),wi);function LQ(){return{and:fQ,between:TQ,eq:uQ,exists:CQ,gt:hQ,gte:gQ,ilike:kQ,inArray:yQ,isNull:xQ,isNotNull:SQ,like:DQ,lt:_Q,lte:vQ,ne:dQ,not:mQ,notBetween:EQ,notExists:wQ,notLike:OQ,notIlike:AQ,notInArray:bQ,or:pQ,sql:$}}function RQ(){return{sql:$,asc:jQ,desc:MQ}}function zQ(e,t){Object.keys(e).length===1&&`default`in e&&!Q(e.default,ZX)&&(e=e.default);let n={},r={},i={};for(let[o,s]of Object.entries(e))if(Q(s,ZX)){var a;let e=$X(s),t=r[e];n[e]=o,i[o]={tsName:o,dbName:s[ZX.Symbol.Name],schema:s[ZX.Symbol.Schema],columns:s[ZX.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]};for(let e of Object.values(s[ZX.Symbol.Columns]))e.primary&&i[o].primaryKey.push(e);let c=(a=s[ZX.Symbol.ExtraConfigBuilder])?.call(s,s[ZX.Symbol.ExtraConfigColumns]);if(c)for(let e of Object.values(c))Q(e,sQ)&&i[o].primaryKey.push(...e.columns)}else if(Q(s,PQ)){let e=$X(s.table),a=n[e],o=s.config(t(s.table)),c;for(let[t,n]of Object.entries(o))if(a){let e=i[a];e.relations[t]=n,c&&e.primaryKey.push(...c)}else e in r||(r[e]={relations:{},primaryKey:c}),r[e].relations[t]=n}return{tables:i,tableNamesMap:n}}function BQ(e){return function(t,n){return new FQ(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function VQ(e){return function(t,n){return new IQ(e,t,n)}}function HQ(e,t,n){if(Q(n,FQ)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[$X(n.referencedTable)];if(!r)throw Error(`Table "${n.referencedTable[ZX.Symbol.Name]}" not found in schema`);let i=e[r];if(!i)throw Error(`Table "${r}" not found in schema`);let a=n.sourceTable,o=t[$X(a)];if(!o)throw Error(`Table "${a[ZX.Symbol.Name]}" not found in schema`);let s=[];for(let e of Object.values(i.relations))(n.relationName&&n!==e&&e.relationName===n.relationName||!n.relationName&&e.referencedTable===n.sourceTable)&&s.push(e);if(s.length>1)throw n.relationName?Error(`There are multiple relations with name "${n.relationName}" in table "${r}"`):Error(`There are multiple relations between "${r}" and "${n.sourceTable[ZX.Symbol.Name]}". Please specify relation name`);if(s[0]&&Q(s[0],FQ)&&s[0].config)return{fields:s[0].config.references,references:s[0].config.fields};throw Error(`There is not enough information to infer relation "${o}.${n.fieldName}"`)}function UQ(e){return{one:BQ(e),many:VQ(e)}}function WQ(e,t,n,r,i=e=>e){let a={};for(let[o,s]of r.entries())if(s.isJson){let r=t.relations[s.tsKey],c=n[o],l=typeof c==`string`?JSON.parse(c):c;a[s.tsKey]=Q(r,FQ)?l&&WQ(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>WQ(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=Q(t,uX)?t:Q(t,iZ)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}var GQ=(Ti=class t{constructor(t){e.defineProperty(this,`config`,void 0),this.config={...t}}get(e,n){if(n===`_`)return{...e._,selectedFields:new Proxy(e._.selectedFields,this)};if(n===HX)return{...e[HX],selectedFields:new Proxy(e[HX].selectedFields,this)};if(typeof n==`symbol`)return e[n];let r=Q(e,IX)?e._.selectedFields:Q(e,mZ)?e[HX].selectedFields:e,i=r[n];if(Q(i,iZ.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!i.isSelectionField)return i.sql;let e=i.clone();return e.isSelectionField=!0,e}if(Q(i,iZ)){if(this.config.sqlBehavior===`sql`)return i;throw Error(`You tried to reference "${n}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return Q(i,uX)?this.config.alias?new Proxy(i,new hZ(new Proxy(i.table,new gZ(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!=`object`||!i?i:new Proxy(i,new t(this.config))}},e.defineProperty(Ti,Z,`SelectionProxyHandler`),Ti);function KQ(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.map(e=>e.toLowerCase()).join(`_`)}function qQ(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.reduce((e,t,n)=>{let r=n===0?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`;return e+r},``)}function JQ(e){return e}var YQ=(Ei=class{constructor(t){e.defineProperty(this,`cache`,{}),e.defineProperty(this,`cachedTables`,{}),e.defineProperty(this,`convert`,void 0),this.convert=t===`snake_case`?KQ:t===`camelCase`?qQ:JQ}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=e.table[ZX.Symbol.Schema]??`public`,n=e.table[ZX.Symbol.OriginalName],r=`${t}.${n}.${e.name}`;return this.cache[r]||this.cacheTable(e.table),this.cache[r]}cacheTable(e){let t=e[ZX.Symbol.Schema]??`public`,n=e[ZX.Symbol.OriginalName],r=`${t}.${n}`;if(!this.cachedTables[r]){for(let t of Object.values(e[ZX.Symbol.Columns])){let e=`${r}.${t.name}`;this.cache[e]=this.convert(t.name)}this.cachedTables[r]=!0}}clearCache(){this.cache={},this.cachedTables={}}},e.defineProperty(Ei,Z,`CasingCache`),Ei),XQ=(Di=class extends mZ{},e.defineProperty(Di,Z,`PgViewBase`),Di),ZQ=(Oi=class{constructor(t){e.defineProperty(this,`casing`,void 0),this.casing=new YQ(t?.casing)}async migrate(e,t,n){let r=typeof n==`string`?`__drizzle_migrations`:n.migrationsTable??`__drizzle_migrations`,i=typeof n==`string`?`drizzle`:n.migrationsSchema??`drizzle`,a=$` + `)}\n]`}concat(...t){let n=this.schema,r=this.data.concat(t.flatMap(({data:e})=>e));return new e(n,r.map(e=>new kR(n,e)))}slice(t,n){let r=this.schema;[t,n]=kI({length:this.numRows},t,n);let i=iL(this.data,this._offsets,t,n);return new e(r,i.map(e=>new kR(r,e)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&et.children[e]);if(t.length===0){let{type:n}=this.schema.fields[e],r=$I({type:n,length:0,nullCount:0});t.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new CL(t)}return null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)?.findIndex(t=>t.name===e),t)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(t));[e[t],o[t]]=[a,n],[r,i]=CR(r,o)}return new e(r,i)}select(e){let t=this.schema.fields.reduce((e,t,n)=>e.set(t.name,n),new Map);return this.selectAt(e.map(e=>t.get(e)).filter(e=>e>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(e=>e.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((e,t,r)=>{let[i,a]=e,o=n.findIndex(e=>e.name===t.name);return~o?a[o]=r:i.push(r),e},[[],[]]),a=this.schema.assign(t.schema),o=[...n.map((e,t)=>[t,i[t]]).map(([e,n])=>n===void 0?this.getChildAt(e):t.getChildAt(n)),...r.map(e=>t.getChildAt(e))].filter(Boolean);return new e(...CR(a,o))}};ER=Symbol.toStringTag,DR[ER]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=sL(oL),e.get=sL(bI.getVisitFn(Y.Struct)),e.set=cL(wF.getVisitFn(Y.Struct)),e.indexOf=lL(hL.getVisitFn(Y.Struct)),`Table`))(DR.prototype);var OR,kR=class e{constructor(...e){switch(e.length){case 2:if([this.schema]=e,!(this.schema instanceof DL)||([,this.data=$I({nullCount:0,type:new gP(this.schema.fields),children:this.schema.fields.map(e=>$I({type:e.type,nullCount:0}))})]=e,!(this.data instanceof XI)))throw TypeError(`RecordBatch constructor expects a [Schema, Data] pair.`);[this.schema,this.data]=AR(this.schema,this.data.children);break;case 1:{let[t]=e,{fields:n,children:r,length:i}=Object.keys(t).reduce((e,n,r)=>(e.children[r]=t[n],e.length=Math.max(e.length,t[n].length),e.fields[r]=OL.new({name:n,type:t[n].type,nullable:!0}),e),{length:0,fields:[],children:[]}),a=new DL(n),o=$I({type:new gP(n),length:i,children:r,nullCount:0});[this.schema,this.data]=AR(a,o.children,i);break}default:throw TypeError(`RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.`)}}get dictionaries(){return this._dictionaries||=jR(this.schema.fields,this.data.children)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return bI.visit(this.data,e)}at(e){return this.get(AI(e,this.numRows))}set(e,t){return wF.visit(this.data,e,t)}indexOf(e,t){return hL.visit(this.data,e,t)}[Symbol.iterator](){return yL.visit(new CL([this.data]))}toArray(){return[...this]}concat(...e){return new DR(this.schema,[this,...e])}slice(t,n){let[r]=new CL([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)?.findIndex(t=>t.name===e))}getChildAt(e){return e>-1&&et.name===e),t)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&tt.name===e);~t&&(i[t]=this.data.children[t])}return new e(n,$I({type:r,length:this.numRows,children:i}))}selectAt(t){let n=this.schema.selectAt(t),r=t.map(e=>this.data.children[e]).filter(Boolean),i=$I({type:new gP(n.fields),length:this.numRows,children:r});return new e(n,i)}};OR=Symbol.toStringTag,kR[OR]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,`RecordBatch`))(kR.prototype);function AR(e,t,n=t.reduce((e,t)=>Math.max(e,t.length),0)){var r;let i=[...e.fields],a=[...t],o=(n+63&-64)>>3;for(let[s,c]of e.fields.entries()){let e=t[s];(!e||e.length!==n)&&(i[s]=c.clone({nullable:!0}),a[s]=(r=e?._changeLengthAndBackfillNullBitmap(n))??$I({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),$I({type:new gP(i),length:n,children:a})]}function jR(e,t,n=new Map){var r,i;if(((r=e?.length)??0)>0&&e?.length===t?.length)for(let r=-1,a=e.length;++r$I({type:e.type})),n=$I({type:new gP(e.fields),nullCount:0,children:t});super(e,n)}},NR=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+hM),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):oM.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):rN.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt(`0`)}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new PM).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,oM.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,rN.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt(`0`))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){let t=e.endObject();return t}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(t,n,r,i,a,o){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,a),e.addCustomMetadata(t,o),e.endMessage(t)}},PR=class extends wP{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return JM.startNull(t),JM.endNull(t)}visitInt(e,t){return MM.startInt(t),MM.addBitWidth(t,e.bitWidth),MM.addIsSigned(t,e.isSigned),MM.endInt(t)}visitFloat(e,t){return HM.startFloatingPoint(t),HM.addPrecision(t,e.precision),HM.endFloatingPoint(t)}visitBinary(e,t){return FM.startBinary(t),FM.endBinary(t)}visitLargeBinary(e,t){return WM.startLargeBinary(t),WM.endLargeBinary(t)}visitBool(e,t){return IM.startBool(t),IM.endBool(t)}visitUtf8(e,t){return $M.startUtf8(t),$M.endUtf8(t)}visitLargeUtf8(e,t){return GM.startLargeUtf8(t),GM.endLargeUtf8(t)}visitDecimal(e,t){return RM.startDecimal(t),RM.addScale(t,e.scale),RM.addPrecision(t,e.precision),RM.addBitWidth(t,e.bitWidth),RM.endDecimal(t)}visitDate(e,t){return LM.startDate(t),LM.addUnit(t,e.unit),LM.endDate(t)}visitTime(e,t){return XM.startTime(t),XM.addUnit(t,e.unit),XM.addBitWidth(t,e.bitWidth),XM.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return ZM.startTimestamp(t),ZM.addUnit(t,e.unit),n!==void 0&&ZM.addTimezone(t,n),ZM.endTimestamp(t)}visitInterval(e,t){return UM.startInterval(t),UM.addUnit(t,e.unit),UM.endInterval(t)}visitDuration(e,t){return zM.startDuration(t),zM.addUnit(t,e.unit),zM.endDuration(t)}visitList(e,t){return KM.startList(t),KM.endList(t)}visitStruct(e,t){return YM.startStruct_(t),YM.endStruct_(t)}visitUnion(e,t){QM.startTypeIdsVector(t,e.typeIds.length);let n=QM.createTypeIdsVector(t,e.typeIds);return QM.startUnion(t),QM.addMode(t,e.mode),QM.addTypeIds(t,n),QM.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return NM.startDictionaryEncoding(t),NM.addId(t,BigInt(e.id)),NM.addIsOrdered(t,e.isOrdered),n!==void 0&&NM.addIndexType(t,n),NM.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return BM.startFixedSizeBinary(t),BM.addByteWidth(t,e.byteWidth),BM.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return VM.startFixedSizeList(t),VM.addListSize(t,e.listSize),VM.endFixedSizeList(t)}visitMap(e,t){return qM.startMap(t),qM.addKeysSorted(t,e.keysSorted),qM.endMap(t)}};const FR=new PR;function IR(e,t=new Map){return new DL(zR(e,t),GR(e.metadata),t)}function LR(e){return new ZR(e.count,VR(e.columns),HR(e.columns))}function RR(e){return new QR(LR(e.data),e.id,e.isDelta)}function zR(e,t){return(e.fields||[]).filter(Boolean).map(e=>OL.fromJSON(e,t))}function BR(e,t){return(e.children||[]).filter(Boolean).map(e=>OL.fromJSON(e,t))}function VR(e){return(e||[]).reduce((e,t)=>[...e,new ez(t.count,UR(t.VALIDITY)),...VR(t.children)],[])}function HR(e,t=[]){for(let n=-1,r=(e||[]).length;++ne+ +(t===0),0)}function WR(e,t){let n,r,i,a,o,s;return!t||!(a=e.dictionary)?(o=qR(e,BR(e,t)),i=new OL(e.name,o,e.nullable,GR(e.metadata))):t.has(n=a.id)?(r=(r=a.indexType)?KR(r):new JN,s=new SP(t.get(n),r,n,a.isOrdered),i=new OL(e.name,s,e.nullable,GR(e.metadata))):(r=(r=a.indexType)?KR(r):new JN,t.set(n,o=qR(e,BR(e,t))),s=new SP(o,r,n,a.isOrdered),i=new OL(e.name,s,e.nullable,GR(e.metadata))),i||null}function GR(e=[]){return new Map(e.map(({key:e,value:t})=>[e,t]))}function KR(e){return new GN(e.isSigned,e.bitWidth)}function qR(e,t){let n=e.type.name;switch(n){case`NONE`:return new WN;case`null`:return new WN;case`binary`:return new iP;case`largebinary`:return new aP;case`utf8`:return new oP;case`largeutf8`:return new sP;case`bool`:return new cP;case`list`:return new hP((t||[])[0]);case`struct`:return new gP(t||[]);case`struct_`:return new gP(t||[])}switch(n){case`int`:{let t=e.type;return new GN(t.isSigned,t.bitWidth)}case`floatingpoint`:{let t=e.type;return new eP(cM[t.precision])}case`decimal`:{let t=e.type;return new lP(t.scale,t.precision,t.bitWidth)}case`date`:{let t=e.type;return new uP(lM[t.unit])}case`time`:{let t=e.type;return new dP(uM[t.unit],t.bitWidth)}case`timestamp`:{let t=e.type;return new fP(uM[t.unit],t.timezone)}case`interval`:{let t=e.type;return new pP(dM[t.unit])}case`duration`:{let t=e.type;return new mP(uM[t.unit])}case`union`:{let n=e.type,[r,...i]=(n.mode+``).toLowerCase(),a=r.toUpperCase()+i.join(``);return new _P(sM[a],n.typeIds||[],t||[])}case`fixedsizebinary`:{let t=e.type;return new vP(t.byteWidth)}case`fixedsizelist`:{let n=e.type;return new yP(n.listSize,(t||[])[0])}case`map`:{let n=e.type;return new bP((t||[])[0],n.keysSorted)}}throw Error(`Unrecognized type: "${n}"`)}var JR=SM,YR=xM,XR=class e{static fromJSON(t,n){let r=new e(0,oM.V5,n);return r._createHeader=tz(t,n),r}static decode(t){t=new YR(Wj(t));let n=NR.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),a=n.headerType(),o=new e(r,i,a);return o._createHeader=nz(n,a),o}static encode(e){let t=new JR,n=-1;return e.isSchema()?n=DL.encode(t,e.header()):e.isRecordBatch()?n=ZR.encode(t,e.header()):e.isDictionaryBatch()&&(n=QR.encode(t,e.header())),NR.startMessage(t),NR.addVersion(t,oM.V5),NR.addHeader(t,n),NR.addHeaderType(t,e.headerType),NR.addBodyLength(t,BigInt(e.bodyLength)),NR.finishMessageBuffer(t,NR.endMessage(t)),t.asUint8Array()}static from(t,n=0){if(t instanceof DL)return new e(0,oM.V5,rN.Schema,t);if(t instanceof ZR)return new e(n,oM.V5,rN.RecordBatch,t);if(t instanceof QR)return new e(n,oM.V5,rN.DictionaryBatch,t);throw Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===rN.Schema}isRecordBatch(){return this.headerType===rN.RecordBatch}isDictionaryBatch(){return this.headerType===rN.DictionaryBatch}constructor(e,t,n,r){this._version=t,this._headerType=n,this.body=new Uint8Array,r&&(this._createHeader=()=>r),this._bodyLength=sN(e)}},ZR=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,n){this._nodes=t,this._buffers=n,this._length=sN(e)}},QR=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=sN(t)}},$R=class{constructor(e,t){this.offset=sN(e),this.length=sN(t)}},ez=class{constructor(e,t){this.length=sN(e),this.nullCount=sN(t)}};function tz(e,t){return()=>{switch(t){case rN.Schema:return DL.fromJSON(e);case rN.RecordBatch:return ZR.fromJSON(e);case rN.DictionaryBatch:return QR.fromJSON(e)}throw Error(`Unrecognized Message type: { name: ${rN[t]}, type: ${t} }`)}}function nz(e,t){return()=>{switch(t){case rN.Schema:return DL.decode(e.header(new nN),new Map,e.version());case rN.RecordBatch:return ZR.decode(e.header(new OM),e.version());case rN.DictionaryBatch:return QR.decode(e.header(new kM),e.version())}throw Error(`Unrecognized Message type: { name: ${rN[t]}, type: ${t} }`)}}OL.encode=_z,OL.decode=fz,OL.fromJSON=WR,DL.encode=gz,DL.decode=rz,DL.fromJSON=IR,ZR.encode=vz,ZR.decode=iz,ZR.fromJSON=LR,QR.encode=yz,QR.decode=az,QR.fromJSON=RR,ez.encode=bz,ez.decode=sz,$R.encode=xz,$R.decode=oz;function rz(e,t=new Map,n=oM.V5){let r=uz(e,t);return new DL(r,pz(e),t,n)}function iz(e,t=oM.V5){if(e.compression()!==null)throw Error(`Record batch compression not implemented`);return new ZR(e.length(),cz(e),lz(e,t))}function az(e,t=oM.V5){return new QR(ZR.decode(e.data(),t),e.id(),e.isDelta())}function oz(e){return new $R(e.offset(),e.length())}function sz(e){return new ez(e.length(),e.nullCount())}function cz(e){let t=[];for(let n,r=-1,i=-1,a=e.nodesLength();++rOL.encode(e,t));nN.startFieldsVector(e,n.length);let r=nN.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?nN.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return PM.startKeyValue(e),PM.addKey(e,r),PM.addValue(e,i),PM.endKeyValue(e)})):-1;return nN.startSchema(e),nN.addFields(e,r),nN.addEndianness(e,Sz?AM.Little:AM.Big),i!==-1&&nN.addCustomMetadata(e,i),nN.endSchema(e)}function _z(e,t){let n=-1,r=-1,i=-1,a=t.type,o=t.typeId;UN.isDictionary(a)?(o=a.dictionary.typeId,i=FR.visit(a,e),r=FR.visit(a.dictionary,e)):r=FR.visit(a,e);let s=(a.children||[]).map(t=>OL.encode(e,t)),c=tN.createChildrenVector(e,s),l=t.metadata&&t.metadata.size>0?tN.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return PM.startKeyValue(e),PM.addKey(e,r),PM.addValue(e,i),PM.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),tN.startField(e),tN.addType(e,r),tN.addTypeType(e,o),tN.addChildren(e,c),tN.addNullable(e,!!t.nullable),n!==-1&&tN.addName(e,n),i!==-1&&tN.addDictionary(e,i),l!==-1&&tN.addCustomMetadata(e,l),tN.endField(e)}function vz(e,t){let n=t.nodes||[],r=t.buffers||[];OM.startNodesVector(e,n.length);for(let t of n.slice().reverse())ez.encode(e,t);let i=e.endVector();OM.startBuffersVector(e,r.length);for(let t of r.slice().reverse())$R.encode(e,t);let a=e.endVector();return OM.startRecordBatch(e),OM.addLength(e,BigInt(t.length)),OM.addNodes(e,i),OM.addBuffers(e,a),OM.endRecordBatch(e)}function yz(e,t){let n=ZR.encode(e,t.data);return kM.startDictionaryBatch(e),kM.addId(e,BigInt(t.id)),kM.addIsDelta(e,t.isDelta),kM.addData(e,n),kM.endDictionaryBatch(e)}function bz(e,t){return DM.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function xz(e,t){return EM.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const Sz=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),Cz=e=>`Expected ${rN[e]} Message in stream, but was null or length 0.`,wz=e=>`Header pointer of flatbuffer-encoded ${rN[e]} Message is null or length 0.`,Tz=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,Ez=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;var Dz=class{constructor(e){this.source=e instanceof VL?e:new VL(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?IL:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(Cz(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array;let t=Wj(this.source.read(e));if(t.byteLength[...e,...n.VALIDITY&&[n.VALIDITY]||[],...n.TYPE_ID&&[n.TYPE_ID]||[],...n.OFFSET&&[n.OFFSET]||[],...n.DATA&&[n.DATA]||[],...t(n.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(Cz(e));return t.value}readSchema(){let e=rN.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw Error(wz(e));return n}};const Az=4,jz=`ARROW1`,Mz=new Uint8Array(jz.length);for(let e=0;ethis):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Qj.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Qj.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}static from(t){return t instanceof e?t:Dj(t)?Zz(t):kj(t)?eB(t):wj(t)?(()=>uj(this,void 0,void 0,function*(){return yield e.from(yield t)}))():Aj(t)||Nj(t)||Fj(t)||Ej(t)?$z(new HL(t)):Qz(new VL(t))}static readAll(t){return t instanceof e?t.isSync()?Yz(t):Xz(t):Dj(t)||ArrayBuffer.isView(t)||Tj(t)||Oj(t)?Yz(t):Xz(t)}},Rz=class extends Lz{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return pj(this,arguments,function*(){yield fj(yield*mj(hj(this[Symbol.iterator]())))})}},zz=class extends Lz{constructor(e){super(e),this._impl=e}readAll(){return uj(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=hj(this),s;s=yield o.next(),e=s.done,!e;a=!0){r=s.value,a=!1;let e=r;i.push(e)}}catch(e){t={error:e}}finally{try{!a&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw Error(`AsyncRecordBatchStreamReader is not Iterable`)}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Bz=class extends Rz{constructor(e){super(e),this._impl=e}},Vz=class extends zz{constructor(e){super(e),this._impl=e}},Hz=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let n=this._loadVectors(e,t,this.schema.fields),r=$I({type:new gP(this.schema.fields),length:e.length,children:n});return new kR(this.schema,r)}_loadDictionaryBatch(e,t){let{id:n,isDelta:r}=e,{dictionaries:i,schema:a}=this,o=i.get(n),s=a.dictionaries.get(n),c=this._loadVectors(e.data,t,[s]);return(o&&r?o.concat(new CL(c)):new CL(c)).memoize()}_loadVectors(e,t,n){return new tR(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},Uz=class extends Hz{constructor(e,t){super(t),this._reader=Dj(e)?new kz(this._handle=e):new Dz(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=Jz(this,e),(this.schema||=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):IL}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):IL}next(){if(this.closed)return IL;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new MR(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Wz=class extends Hz{constructor(e,t){super(t),this._reader=new Oz(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return uj(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return uj(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Jz(this,e),(this.schema||=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return uj(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):IL})}return(e){return uj(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):IL})}next(){return uj(this,void 0,void 0,function*(){if(this.closed)return IL;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new MR(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return uj(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},Gz=class extends Uz{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof GL?e:new GL(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let n=(t=this._footer)?.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(rN.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null}_readDictionaryBatch(e){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(rN.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}}_readFooter(){let{_handle:e}=this,t=e.size-Fz,n=e.readInt32(t),r=e.readAt(t-n,n);return NL.decode(r)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return uj(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return uj(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let n=(t=this._footer)?.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(rN.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null})}_readDictionaryBatch(e){return uj(this,void 0,void 0,function*(){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(rN.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}})}_readFooter(){return uj(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Fz,n=yield e.readInt32(t),r=yield e.readAt(t-n,n);return NL.decode(r)})}_readNextMessageAndValidate(e){return uj(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Nz(t)?new Bz(new Gz(e.read())):new Rz(new Uz(e)):new Rz(new Uz(function*(){}()))}function $z(e){return uj(this,void 0,void 0,function*(){let t=yield e.peek(Pz+7&-8);return t&&t.byteLength>=4?Nz(t)?new Bz(new Gz(yield e.read())):new zz(new Wz(e)):new zz(new Wz(function(){return pj(this,arguments,function*(){})}()))})}function eB(e){return uj(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new KL(e,t);return t>=Iz&&Nz(yield n.readAt(0,Pz+7&-8))?new Vz(new Kz(n)):new zz(new Wz(n))})}var tB=class e extends wP{static assemble(...t){let n=e=>e.flatMap(e=>Array.isArray(e)?n(e):e instanceof kR?e.data.children:e.data),r=new e;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof CL)return this.visitMany(e.data),this;let{type:t}=e;if(!UN.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw RangeError(`Cannot write arrays larger than 2^31 - 1 in length`);if(UN.isUnion(t))this.nodes.push(new ez(n,0));else{let{nullCount:r}=e;UN.isNull(t)||nB.call(this,r<=0?new Uint8Array:UI(e.offset,n,e.nullBitmap)),this.nodes.push(new ez(n,r))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function nB(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new $R(this._byteLength,t)),this._byteLength+=t,this}function rB(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:a}=e;if(nB.call(this,i),n.mode===sM.Sparse)return cB.call(this,e);if(n.mode===sM.Dense){if(e.offset<=0)return nB.call(this,a),cB.call(this,e);{let o=new Int32Array(r),s=Object.create(null),c=Object.create(null);for(let e,n,l=-1;++l{let i=n.typeIds[t],a=s[i],o=c[i];return e.slice(a,Math.min(r,o))}))}}return this}function iB(e){let t;return e.nullCount>=e.length?nB.call(this,new Uint8Array):(t=e.values)instanceof Uint8Array?nB.call(this,UI(e.offset,e.length,t)):nB.call(this,WI(e.values))}function aB(e){return nB.call(this,e.values.subarray(0,e.length*e.stride))}function oB(e){let{length:t,values:n,valueOffsets:r}=e,i=sN(r[0]),a=sN(r[t]),o=Math.min(a-i,n.byteLength-i);return nB.call(this,Xj(-i,t+1,r)),nB.call(this,n.subarray(i,i+o)),this}function sB(e){let{length:t,valueOffsets:n}=e;if(n){let{0:r,[t]:i}=n;return nB.call(this,Xj(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function cB(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}tB.prototype.visitBool=iB,tB.prototype.visitInt=aB,tB.prototype.visitFloat=aB,tB.prototype.visitUtf8=oB,tB.prototype.visitLargeUtf8=oB,tB.prototype.visitBinary=oB,tB.prototype.visitLargeBinary=oB,tB.prototype.visitFixedSizeBinary=aB,tB.prototype.visitDate=aB,tB.prototype.visitTimestamp=aB,tB.prototype.visitTime=aB,tB.prototype.visitDecimal=aB,tB.prototype.visitList=sB,tB.prototype.visitStruct=cB,tB.prototype.visitUnion=rB,tB.prototype.visitInterval=aB,tB.prototype.visitDuration=aB,tB.prototype.visitFixedSizeList=sB,tB.prototype.visitMap=sB;var lB=class extends RL{static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}constructor(e){super(),this._position=0,this._started=!1,this._sink=new BL,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Cj(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy==`boolean`?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat==`boolean`?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return wj(e)?e.then(e=>this.writeAll(e)):Ej(e)?pB(this,e):fB(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof BL?this._sink=e:(this._sink=new BL,e&&Mj(e)?this.toDOMStream({type:`bytes`}).pipeTo(e):e&&Pj(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!SR(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null||e instanceof DR&&!(t=e.schema)||e instanceof kR&&!(t=e.schema))return this.finish()&&void 0}else throw Error(`RecordBatchWriter is closed`);if(t&&!SR(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof kR?e instanceof MR||this._writeRecordBatch(e):e instanceof DR?this.writeAll(e.batches):Tj(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,r=XR.encode(e),i=r.byteLength,a=this._writeLegacyIpcFormat?4:8,o=i+a+n&~n,s=o-i-a;return e.headerType===rN.RecordBatch?this._recordBatchBlocks.push(new FL(o,e.bodyLength,this._position)):e.headerType===rN.DictionaryBatch&&this._dictionaryBlocks.push(new FL(o,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-a)),i>0&&this._write(r),this._writePadding(s)}_write(e){if(this._started){let t=Wj(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(XR.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Mz)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:r,buffers:i}=tB.assemble(e),a=new ZR(e.numRows,n,r),o=XR.from(a,t);return this._writeDictionaries(e)._writeMessage(o)._writeBodyBuffers(i)}_writeDictionaryBatch(e,t,n=!1){let{byteLength:r,nodes:i,bufferRegions:a,buffers:o}=tB.assemble(new CL([e])),s=new ZR(e.length,i,a),c=new QR(s,t,n),l=XR.from(c,r);return this._writeMessage(l)._writeBodyBuffers(o)}_writeBodyBuffers(e){let t,n,r;for(let i=-1,a=e.length;++i0&&(this._write(t),(r=(n+7&-8)-n)>0&&this._writePadding(r));return this}_writeDictionaries(e){var t,n;for(let[r,i]of e.dictionaries){let e=(t=i?.data)??[],a=this._seenDictionaries.get(r),o=(n=this._dictionaryDeltaOffsets.get(r))??0;if(!a||a.data[0]!==e[0])for(let[t,n]of e.entries())this._writeDictionaryBatch(n,r,t>0);else if(or.writeAll(e)):Ej(t)?pB(r,t):fB(r,t)}},dB=class e extends lB{static writeAll(t){let n=new e;return wj(t)?t.then(e=>n.writeAll(e)):Ej(t)?pB(n,t):fB(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,n=!1){if(!n&&this._seenDictionaries.has(t))throw Error(`The Arrow File format does not support replacement dictionaries. `);return super._writeDictionaryBatch(e,t,n)}_writeFooter(e){let t=NL.encode(new NL(e,oM.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function fB(e,t){let n=t;t instanceof DR&&(n=t.batches,e.reset(void 0,t.schema));for(let t of n)e.write(t);return e.finish()}function pB(e,t){return uj(this,void 0,void 0,function*(){var n,r,i,a,o,s,c;try{for(n=!0,r=hj(t);i=yield r.next(),a=i.done,!a;n=!0){c=i.value,n=!1;let t=c;e.write(t)}}catch(e){o={error:e}}finally{try{!n&&!a&&(s=r.return)&&(yield s.call(r))}finally{if(o)throw o.error}}return e.finish()})}function mB(e,t=`stream`){return(t===`stream`?uB:dB).writeAll(e).toUint8Array(!0)}var hB=Object.create,gB=Object.defineProperty,_B=Object.getOwnPropertyDescriptor,vB=Object.getOwnPropertyNames,yB=Object.getPrototypeOf,bB=Object.prototype.hasOwnProperty,xB=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),SB=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of vB(t))!bB.call(e,i)&&i!==n&&gB(e,i,{get:()=>t[i],enumerable:!(r=_B(t,i))||r.enumerable});return e},CB=(e,t,n)=>(n=e==null?{}:hB(yB(e)),SB(t||!e||!e.__esModule?gB(n,`default`,{value:e,enumerable:!0}):n,e)),wB=xB((e,t)=>{t.exports=Worker}),TB=(e=>(e[e.UNDEFINED=0]=`UNDEFINED`,e[e.AUTOMATIC=1]=`AUTOMATIC`,e[e.READ_ONLY=2]=`READ_ONLY`,e[e.READ_WRITE=3]=`READ_WRITE`,e))(TB||{}),EB=(e=>(e[e.IDENTIFIER=0]=`IDENTIFIER`,e[e.NUMERIC_CONSTANT=1]=`NUMERIC_CONSTANT`,e[e.STRING_CONSTANT=2]=`STRING_CONSTANT`,e[e.OPERATOR=3]=`OPERATOR`,e[e.KEYWORD=4]=`KEYWORD`,e[e.COMMENT=5]=`COMMENT`,e))(EB||{}),DB=(e=>(e[e.NONE=0]=`NONE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARNING=3]=`WARNING`,e[e.ERROR=4]=`ERROR`,e))(DB||{}),OB=(e=>(e[e.NONE=0]=`NONE`,e[e.CONNECT=1]=`CONNECT`,e[e.DISCONNECT=2]=`DISCONNECT`,e[e.OPEN=3]=`OPEN`,e[e.QUERY=4]=`QUERY`,e[e.INSTANTIATE=5]=`INSTANTIATE`,e))(OB||{}),kB=(e=>(e[e.NONE=0]=`NONE`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`,e[e.START=3]=`START`,e[e.RUN=4]=`RUN`,e[e.CAPTURE=5]=`CAPTURE`,e))(kB||{}),AB=(e=>(e[e.NONE=0]=`NONE`,e[e.WEB_WORKER=1]=`WEB_WORKER`,e[e.NODE_WORKER=2]=`NODE_WORKER`,e[e.BINDINGS=3]=`BINDINGS`,e[e.ASYNC_DUCKDB=4]=`ASYNC_DUCKDB`,e))(AB||{}),jB=class{log(e){}},MB=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},NB=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e))(NB||{}),PB=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),n=Lz.from(t);return console.assert(n.isSync(),`Reader is not sync`),console.assert(n.isFile(),`Reader is not file`),new DR(n)}async send(e,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let n=await this._bindings.startPendingQuery(this._conn,e,t);for(;n==null;)n=await this._bindings.pollPendingQuery(this._conn);let r=new FB(this._bindings,this._conn,n),i=await Lz.from(r);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new IB(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=mB(e,`stream`);await this.insertArrowFromIPCStream(n,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},FB=class{constructor(e,t,n){this.db=e,this.conn=t,this.header=n,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight==null?e=await this.db.fetchQueryResults(this.conn):(e=await this._inFlight,this._inFlight=null),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},IB=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),n=Lz.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new DR(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new FB(this.bindings,this.connectionId,t),r=await Lz.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},LB=(e=>(e.CANCEL_PENDING_QUERY=`CANCEL_PENDING_QUERY`,e.CLOSE_PREPARED=`CLOSE_PREPARED`,e.COLLECT_FILE_STATISTICS=`COLLECT_FILE_STATISTICS`,e.REGISTER_OPFS_FILE_NAME=`REGISTER_OPFS_FILE_NAME`,e.CONNECT=`CONNECT`,e.COPY_FILE_TO_BUFFER=`COPY_FILE_TO_BUFFER`,e.COPY_FILE_TO_PATH=`COPY_FILE_TO_PATH`,e.CREATE_PREPARED=`CREATE_PREPARED`,e.DISCONNECT=`DISCONNECT`,e.DROP_FILE=`DROP_FILE`,e.DROP_FILES=`DROP_FILES`,e.EXPORT_FILE_STATISTICS=`EXPORT_FILE_STATISTICS`,e.FETCH_QUERY_RESULTS=`FETCH_QUERY_RESULTS`,e.FLUSH_FILES=`FLUSH_FILES`,e.GET_FEATURE_FLAGS=`GET_FEATURE_FLAGS`,e.GET_TABLE_NAMES=`GET_TABLE_NAMES`,e.GET_VERSION=`GET_VERSION`,e.GLOB_FILE_INFOS=`GLOB_FILE_INFOS`,e.INSERT_ARROW_FROM_IPC_STREAM=`INSERT_ARROW_FROM_IPC_STREAM`,e.INSERT_CSV_FROM_PATH=`IMPORT_CSV_FROM_PATH`,e.INSERT_JSON_FROM_PATH=`IMPORT_JSON_FROM_PATH`,e.INSTANTIATE=`INSTANTIATE`,e.OPEN=`OPEN`,e.PING=`PING`,e.POLL_PENDING_QUERY=`POLL_PENDING_QUERY`,e.REGISTER_FILE_BUFFER=`REGISTER_FILE_BUFFER`,e.REGISTER_FILE_HANDLE=`REGISTER_FILE_HANDLE`,e.REGISTER_FILE_URL=`REGISTER_FILE_URL`,e.RESET=`RESET`,e.RUN_PREPARED=`RUN_PREPARED`,e.RUN_QUERY=`RUN_QUERY`,e.SEND_PREPARED=`SEND_PREPARED`,e.START_PENDING_QUERY=`START_PENDING_QUERY`,e.TOKENIZE=`TOKENIZE`,e))(LB||{}),RB=(e=>(e.CONNECTION_INFO=`CONNECTION_INFO`,e.ERROR=`ERROR`,e.FEATURE_FLAGS=`FEATURE_FLAGS`,e.FILE_BUFFER=`FILE_BUFFER`,e.FILE_INFOS=`FILE_INFOS`,e.FILE_SIZE=`FILE_SIZE`,e.FILE_STATISTICS=`FILE_STATISTICS`,e.INSTANTIATE_PROGRESS=`INSTANTIATE_PROGRESS`,e.LOG=`LOG`,e.OK=`OK`,e.PREPARED_STATEMENT_ID=`PREPARED_STATEMENT_ID`,e.QUERY_PLAN=`QUERY_PLAN`,e.QUERY_RESULT=`QUERY_RESULT`,e.QUERY_RESULT_CHUNK=`QUERY_RESULT_CHUNK`,e.QUERY_RESULT_HEADER=`QUERY_RESULT_HEADER`,e.QUERY_RESULT_HEADER_OR_NULL=`QUERY_RESULT_HEADER_OR_NULL`,e.REGISTERED_FILE=`REGISTERED_FILE`,e.SCRIPT_TOKENS=`SCRIPT_TOKENS`,e.SUCCESS=`SUCCESS`,e.TABLE_NAMES=`TABLE_NAMES`,e.VERSION_STRING=`VERSION_STRING`,e))(RB||{}),zB=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((e,t)=>{this.promiseResolver=e,this.promiseRejecter=t})}};function BB(e){switch(e.typeId){case Y.Binary:return{sqlType:`binary`};case Y.Bool:return{sqlType:`bool`};case Y.Date:return{sqlType:`date`};case Y.DateDay:return{sqlType:`date32[d]`};case Y.DateMillisecond:return{sqlType:`date64[ms]`};case Y.Decimal:{let t=e;return{sqlType:`decimal`,precision:t.precision,scale:t.scale}}case Y.Float:return{sqlType:`float`};case Y.Float16:return{sqlType:`float16`};case Y.Float32:return{sqlType:`float32`};case Y.Float64:return{sqlType:`float64`};case Y.Int:return{sqlType:`int32`};case Y.Int16:return{sqlType:`int16`};case Y.Int32:return{sqlType:`int32`};case Y.Int64:return{sqlType:`int64`};case Y.Uint16:return{sqlType:`uint16`};case Y.Uint32:return{sqlType:`uint32`};case Y.Uint64:return{sqlType:`uint64`};case Y.Uint8:return{sqlType:`uint8`};case Y.IntervalDayTime:return{sqlType:`interval[dt]`};case Y.IntervalYearMonth:return{sqlType:`interval[m]`};case Y.List:return{sqlType:`list`,valueType:BB(e.valueType)};case Y.FixedSizeBinary:return{sqlType:`fixedsizebinary`,byteWidth:e.byteWidth};case Y.Null:return{sqlType:`null`};case Y.Utf8:return{sqlType:`utf8`};case Y.Struct:return{sqlType:`struct`,fields:e.children.map(e=>VB(e.name,e.type))};case Y.Map:{let t=e;return{sqlType:`map`,keyType:BB(t.keyType),valueType:BB(t.valueType)}}case Y.Time:return{sqlType:`time[s]`};case Y.TimeMicrosecond:return{sqlType:`time[us]`};case Y.TimeMillisecond:return{sqlType:`time[ms]`};case Y.TimeNanosecond:return{sqlType:`time[ns]`};case Y.TimeSecond:return{sqlType:`time[s]`};case Y.Timestamp:return{sqlType:`timestamp`,timezone:e.timezone||void 0};case Y.TimestampSecond:return{sqlType:`timestamp[s]`,timezone:e.timezone||void 0};case Y.TimestampMicrosecond:return{sqlType:`timestamp[us]`,timezone:e.timezone||void 0};case Y.TimestampNanosecond:return{sqlType:`timestamp[ns]`,timezone:e.timezone||void 0};case Y.TimestampMillisecond:return{sqlType:`timestamp[ms]`,timezone:e.timezone||void 0}}throw Error(`unsupported arrow type: ${e.toString()}`)}function VB(e,t){let n=BB(t);return n.name=e,n}var HB=new TextEncoder,UB=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener(`message`,this._onMessageHandler),this._worker.addEventListener(`error`,this._onErrorHandler),this._worker.addEventListener(`close`,this._onCloseHandler),this._workerShutdownPromise=new Promise((e,t)=>{this._workerShutdownResolver=e})}detach(){this._worker&&(this._worker.removeEventListener(`message`,this._onMessageHandler),this._worker.removeEventListener(`error`,this._onErrorHandler),this._worker.removeEventListener(`close`,this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error(`cannot send a message since the worker is not set!`);return}let n=this._nextMessageId++;return this._pendingRequests.set(n,e),this._worker.postMessage({messageId:n,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let n=e.data;switch(n.type){case`LOG`:this._logger.log(n.data);return;case`INSTANTIATE_PROGRESS`:for(let e of this._onInstantiationProgress)e(n.data);return}let r=this._pendingRequests.get(n.requestId);if(!r){console.warn(`unassociated response: [${n.requestId}, ${n.type.toString()}]`);return}if(this._pendingRequests.delete(n.requestId),n.type==`ERROR`){let e=Error(n.data.message);e.name=n.data.name,(t=Object.getOwnPropertyDescriptor(e,`stack`))!=null&&t.writable&&(e.stack=n.data.stack),r.promiseRejecter(e);return}switch(r.type){case`CLOSE_PREPARED`:case`COLLECT_FILE_STATISTICS`:case`REGISTER_OPFS_FILE_NAME`:case`COPY_FILE_TO_PATH`:case`DISCONNECT`:case`DROP_FILE`:case`DROP_FILES`:case`FLUSH_FILES`:case`INSERT_ARROW_FROM_IPC_STREAM`:case`IMPORT_CSV_FROM_PATH`:case`IMPORT_JSON_FROM_PATH`:case`OPEN`:case`PING`:case`REGISTER_FILE_BUFFER`:case`REGISTER_FILE_HANDLE`:case`REGISTER_FILE_URL`:case`RESET`:if(n.type==`OK`){r.promiseResolver(n.data);return}break;case`INSTANTIATE`:if(this._onInstantiationProgress=[],n.type==`OK`){r.promiseResolver(n.data);return}break;case`GLOB_FILE_INFOS`:if(n.type==`FILE_INFOS`){r.promiseResolver(n.data);return}break;case`GET_VERSION`:if(n.type==`VERSION_STRING`){r.promiseResolver(n.data);return}break;case`GET_FEATURE_FLAGS`:if(n.type==`FEATURE_FLAGS`){r.promiseResolver(n.data);return}break;case`GET_TABLE_NAMES`:if(n.type==`TABLE_NAMES`){r.promiseResolver(n.data);return}break;case`TOKENIZE`:if(n.type==`SCRIPT_TOKENS`){r.promiseResolver(n.data);return}break;case`COPY_FILE_TO_BUFFER`:if(n.type==`FILE_BUFFER`){r.promiseResolver(n.data);return}break;case`EXPORT_FILE_STATISTICS`:if(n.type==`FILE_STATISTICS`){r.promiseResolver(n.data);return}break;case`CONNECT`:if(n.type==`CONNECTION_INFO`){r.promiseResolver(n.data);return}break;case`RUN_PREPARED`:case`RUN_QUERY`:if(n.type==`QUERY_RESULT`){r.promiseResolver(n.data);return}break;case`SEND_PREPARED`:if(n.type==`QUERY_RESULT_HEADER`){r.promiseResolver(n.data);return}break;case`START_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`POLL_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`CANCEL_PENDING_QUERY`:if(this._onInstantiationProgress=[],n.type==`SUCCESS`){r.promiseResolver(n.data);return}break;case`FETCH_QUERY_RESULTS`:if(n.type==`QUERY_RESULT_CHUNK`){r.promiseResolver(n.data);return}break;case`CREATE_PREPARED`:if(n.type==`PREPARED_STATEMENT_ID`){r.promiseResolver(n.data);return}break}r.promiseRejecter(Error(`unexpected response type: ${n.type.toString()}`))}onError(e){console.error(e),console.error(`error in duckdb worker: ${e.message}`),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn(`worker terminated with ${this._pendingRequests.size} pending requests`);return}this._pendingRequests.clear()}async reset(){let e=new zB(`RESET`,null);return await this.postTask(e)}async ping(){let e=new zB(`PING`,null);await this.postTask(e)}async dropFile(e){let t=new zB(`DROP_FILE`,e);return await this.postTask(t)}async dropFiles(){let e=new zB(`DROP_FILES`,null);return await this.postTask(e)}async flushFiles(){let e=new zB(`FLUSH_FILES`,null);return await this.postTask(e)}async instantiate(e,t=null,n=e=>{}){this._onInstantiationProgress.push(n);let r=new zB(`INSTANTIATE`,[e,t]);return await this.postTask(r)}async getVersion(){let e=new zB(`GET_VERSION`,null);return await this.postTask(e)}async getFeatureFlags(){let e=new zB(`GET_FEATURE_FLAGS`,null);return await this.postTask(e)}async open(e){let t=new zB(`OPEN`,e);await this.postTask(t)}async tokenize(e){let t=new zB(`TOKENIZE`,e);return await this.postTask(t)}async connectInternal(){let e=new zB(`CONNECT`,null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new PB(this,e)}async disconnect(e){let t=new zB(`DISCONNECT`,e);await this.postTask(t)}async runQuery(e,t){let n=new zB(`RUN_QUERY`,[e,t]);return await this.postTask(n)}async startPendingQuery(e,t,n=!1){let r=new zB(`START_PENDING_QUERY`,[e,t,n]);return await this.postTask(r)}async pollPendingQuery(e){let t=new zB(`POLL_PENDING_QUERY`,e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new zB(`CANCEL_PENDING_QUERY`,e);return await this.postTask(t)}async fetchQueryResults(e){let t=new zB(`FETCH_QUERY_RESULTS`,e);return await this.postTask(t)}async getTableNames(e,t){let n=new zB(`GET_TABLE_NAMES`,[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new zB(`CREATE_PREPARED`,[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new zB(`CLOSE_PREPARED`,[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new zB(`RUN_PREPARED`,[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new zB(`SEND_PREPARED`,[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new zB(`GLOB_FILE_INFOS`,e);return await this.postTask(t)}async registerFileText(e,t){let n=HB.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new zB(`REGISTER_FILE_URL`,[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new zB(`REGISTER_FILE_BUFFER`,[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new zB(`REGISTER_FILE_HANDLE`,[e,t,n,r]);await this.postTask(i,[])}async registerOPFSFileName(e){let t=new zB(`REGISTER_OPFS_FILE_NAME`,[e]);await this.postTask(t,[])}async collectFileStatistics(e,t){let n=new zB(`COLLECT_FILE_STATISTICS`,[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new zB(`EXPORT_FILE_STATISTICS`,e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new zB(`COPY_FILE_TO_BUFFER`,e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new zB(`COPY_FILE_TO_PATH`,[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new zB(`INSERT_ARROW_FROM_IPC_STREAM`,[e,t,n]);await this.postTask(r,[t.buffer])}async insertCSVFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(VB(t,r))}n.columnsFlat=e,delete n.columns}let r=new zB(`IMPORT_CSV_FROM_PATH`,[e,t,n]);await this.postTask(r)}async insertJSONFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(VB(t,r))}n.columnsFlat=e,delete n.columns}let r=new zB(`IMPORT_JSON_FROM_PATH`,[e,t,n]);await this.postTask(r)}};function WB(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<`u`&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var GB=WB(),KB=(e=>(e[e.BUFFER=0]=`BUFFER`,e[e.NODE_FS=1]=`NODE_FS`,e[e.BROWSER_FILEREADER=2]=`BROWSER_FILEREADER`,e[e.BROWSER_FSACCESS=3]=`BROWSER_FSACCESS`,e[e.HTTP=4]=`HTTP`,e[e.S3=5]=`S3`,e))(KB||{}),qB=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])),JB=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])),YB=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])),XB=()=>(async e=>{try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),ZB={name:`@duckdb/duckdb-wasm`,version:`1.29.1-dev68.0`,description:`DuckDB powered by WebAssembly`,license:`MIT`,repository:{type:`git`,url:`https://github.com/duckdb/duckdb-wasm.git`},keywords:[`sql`,`duckdb`,`relational`,`database`,`data`,`query`,`wasm`,`analytics`,`olap`,`arrow`,`parquet`,`json`,`csv`],dependencies:{"apache-arrow":`^17.0.0`},devDependencies:{"@types/emscripten":`^1.39.10`,"@types/jasmine":`^5.1.4`,"@typescript-eslint/eslint-plugin":`^6.21.0`,"@typescript-eslint/parser":`^6.21.0`,esbuild:`^0.20.2`,eslint:`^8.57.0`,"eslint-plugin-jasmine":`^4.1.3`,"eslint-plugin-react":`^7.34.0`,"fast-glob":`^3.3.2`,jasmine:`^5.1.0`,"jasmine-core":`^5.1.2`,"jasmine-spec-reporter":`^7.0.0`,"js-sha256":`^0.11.0`,karma:`^6.4.2`,"karma-chrome-launcher":`^3.2.0`,"karma-coverage":`^2.2.1`,"karma-firefox-launcher":`^2.1.3`,"karma-jasmine":`^5.1.0`,"karma-jasmine-html-reporter":`^2.1.0`,"karma-sourcemap-loader":`^0.4.0`,"karma-spec-reporter":`^0.0.36`,"make-dir":`^4.0.0`,nyc:`^15.1.0`,prettier:`^3.2.5`,puppeteer:`^22.8.0`,rimraf:`^5.0.5`,s3rver:`^3.7.1`,typedoc:`^0.25.13`,typescript:`^5.3.3`,"wasm-feature-detect":`^1.6.1`,"web-worker":`^1.2.0`},scripts:{"build:debug":`node bundle.mjs debug && tsc --emitDeclarationOnly`,"build:release":`node bundle.mjs release && tsc --emitDeclarationOnly`,docs:`typedoc`,report:`node ./coverage.mjs`,"test:node":`node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:debug":`node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:coverage":`nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:firefox":`karma start ./karma/tests-firefox.cjs`,"test:chrome":`karma start ./karma/tests-chrome.cjs`,"test:chrome:eh":`karma start ./karma/tests-chrome-eh.cjs`,"test:chrome:coverage":`karma start ./karma/tests-chrome-coverage.cjs`,"test:browser":`karma start ./karma/tests-all.cjs`,"test:browser:debug":`karma start ./karma/tests-debug.cjs`,test:`npm run test:chrome && npm run test:node`,"test:coverage":`npm run test:chrome:coverage && npm run test:node:coverage && npm run report`,lint:`eslint src test`},files:[`dist`,`!dist/tests-*`,`!dist/duckdb-browser-mvp.worker.js.map`,`!dist/types/test`],main:`dist/duckdb-browser.cjs`,module:`dist/duckdb-browser.mjs`,types:`dist/duckdb-browser.d.ts`,jsdelivr:`dist/duckdb-browser.cjs`,unpkg:`dist/duckdb-browser.mjs`,sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":`./dist/duckdb-mvp.wasm`,"./dist/duckdb-eh.wasm":`./dist/duckdb-eh.wasm`,"./dist/duckdb-coi.wasm":`./dist/duckdb-coi.wasm`,"./dist/duckdb-browser":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser.cjs":`./dist/duckdb-browser.cjs`,"./dist/duckdb-browser.mjs":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser-coi.pthread.worker.js":`./dist/duckdb-browser-coi.pthread.worker.js`,"./dist/duckdb-browser-coi.worker.js":`./dist/duckdb-browser-coi.worker.js`,"./dist/duckdb-browser-eh.worker.js":`./dist/duckdb-browser-eh.worker.js`,"./dist/duckdb-browser-mvp.worker.js":`./dist/duckdb-browser-mvp.worker.js`,"./dist/duckdb-node":`./dist/duckdb-node.cjs`,"./dist/duckdb-node.cjs":`./dist/duckdb-node.cjs`,"./dist/duckdb-node-blocking":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-blocking.cjs":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-eh.worker.cjs":`./dist/duckdb-node-eh.worker.cjs`,"./dist/duckdb-node-mvp.worker.cjs":`./dist/duckdb-node-mvp.worker.cjs`,"./blocking":{node:{types:`./dist/duckdb-node-blocking.d.ts`,require:`./dist/duckdb-node-blocking.cjs`,import:`./dist/duckdb-node-blocking.cjs`},types:`./dist/duckdb-node-blocking.d.ts`,import:`./dist/duckdb-node-blocking.mjs`,require:`./dist/duckdb-node-blocking.cjs`},".":{browser:{types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`},node:{types:`./dist/duckdb-node.d.ts`,import:`./dist/duckdb-node.cjs`,require:`./dist/duckdb-node.cjs`},types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`}}},QB=ZB.name,$B=ZB.version,eV=ZB.version.split(`.`),tV=eV[0],nV=eV[1],rV=eV[2],iV=()=>typeof navigator>`u`,aV=()=>iV()?`node`:navigator.userAgent,oV=()=>aV().includes(`Firefox`),sV=()=>/^((?!chrome|android).)*safari/i.test(aV()),cV=null,lV=null,uV=null,dV=null,fV=null;async function pV(){return cV??=typeof BigInt64Array<`u`,lV??=await JB(),uV??=await XB(),dV??=await YB(),fV??=await qB(),{bigInt64Array:cV,crossOriginIsolated:iV()||globalThis.crossOriginIsolated||!1,wasmExceptions:lV,wasmSIMD:dV,wasmThreads:uV,wasmBulkMemory:fV}}async function mV(e){let t=await pV();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}var hV=CB(wB());const gV=Symbol.for(`constructDateFrom`),_V={},vV={};function yV(e,t){try{let n=_V[e]||(_V[e]=new Intl.DateTimeFormat(`en-GB`,{timeZone:e,hour:`numeric`,timeZoneName:`longOffset`}).format),r=n(t).split(`GMT`)[1]||``;return r in vV?vV[r]:xV(r,r.split(`:`))}catch{if(e in vV)return vV[e];let t=e?.match(bV);return t?xV(e,t.slice(1)):NaN}}const bV=/([+-]\d\d):?(\d\d)?/;function xV(e,t){let n=+t[0],r=+(t[1]||0);return vV[e]=n>0?n*60+r:n*60-r}var SV=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(yV(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),EV(this,NaN),wV(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-yV(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),wV(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};const CV=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!CV.test(e))return;let t=e.replace(CV,`$1UTC`);SV.prototype[t]&&(e.startsWith(`get`)?SV.prototype[e]=function(){return this.internal[t]()}:(SV.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),TV(this),+this},SV.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),wV(this),+this}))});function wV(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function TV(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),EV(e)}function EV(e){let t=yV(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);let r=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),a=r-i,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=r-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=yV(e.timeZone,e),l=-new Date(+e).getTimezoneOffset(),u=l-c,d=c!==t,f=u-s;if(d&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);let t=yV(e.timeZone,e),n=c-t;n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var DV=class e extends SV{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${OV(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=e>0?`-`:`+`,n=String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),r=String(Math.abs(e)%60).padStart(2,`0`);return[t,n,r]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};function OV(e,t){return new Intl.DateTimeFormat(`en-GB`,{timeZone:e,timeZoneName:`long`}).format(t).slice(12)}const kV=new TextDecoder(`utf-8`),AV=e=>kV.decode(e),jV=new TextEncoder,MV=e=>jV.encode(e),NV=e=>typeof e==`function`,PV=e=>e!=null&&Object(e)===e,FV=e=>PV(e)&&NV(e.then),IV=e=>PV(e)&&NV(e[Symbol.iterator]),LV=e=>PV(e)&&NV(e[Symbol.asyncIterator]),RV=e=>PV(e)&&`done`in e&&`value`in e,zV=e=>PV(e)&&NV(e.clear)&&NV(e.bytes)&&NV(e.position)&&NV(e.setPosition)&&NV(e.capacity)&&NV(e.getBufferIdentifier)&&NV(e.createLong);var BV={};xt(BV,{compareArrayLike:()=>TH,joinUint8Arrays:()=>WV,memcpy:()=>UV,rebaseValueOffsets:()=>wH,toArrayBufferView:()=>GV,toArrayBufferViewAsyncIterator:()=>mH,toArrayBufferViewIterator:()=>iH,toBigInt64Array:()=>YV,toBigUint64Array:()=>$V,toFloat32Array:()=>eH,toFloat32ArrayAsyncIterator:()=>xH,toFloat32ArrayIterator:()=>dH,toFloat64Array:()=>tH,toFloat64ArrayAsyncIterator:()=>SH,toFloat64ArrayIterator:()=>fH,toInt16Array:()=>qV,toInt16ArrayAsyncIterator:()=>gH,toInt16ArrayIterator:()=>oH,toInt32Array:()=>JV,toInt32ArrayAsyncIterator:()=>_H,toInt32ArrayIterator:()=>sH,toInt8Array:()=>KV,toInt8ArrayAsyncIterator:()=>hH,toInt8ArrayIterator:()=>aH,toUint16Array:()=>ZV,toUint16ArrayAsyncIterator:()=>yH,toUint16ArrayIterator:()=>lH,toUint32Array:()=>QV,toUint32ArrayAsyncIterator:()=>bH,toUint32ArrayIterator:()=>uH,toUint8Array:()=>XV,toUint8ArrayAsyncIterator:()=>vH,toUint8ArrayIterator:()=>cH,toUint8ClampedArray:()=>nH,toUint8ClampedArrayAsyncIterator:()=>CH,toUint8ClampedArrayIterator:()=>pH});const VV=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function HV(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++cGV(Int8Array,e),qV=e=>GV(Int16Array,e),JV=e=>GV(Int32Array,e),YV=e=>GV(BigInt64Array,e),XV=e=>GV(Uint8Array,e),ZV=e=>GV(Uint16Array,e),QV=e=>GV(Uint32Array,e),$V=e=>GV(BigUint64Array,e),eH=e=>GV(Float32Array,e),tH=e=>GV(Float64Array,e),nH=e=>GV(Uint8ClampedArray,e),rH=e=>(e.next(),e);function*iH(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof VV?n(t):IV(t)?t:n(t);return yield*rH(function*(t){let n=null;do n=t.next(yield GV(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const aH=e=>iH(Int8Array,e),oH=e=>iH(Int16Array,e),sH=e=>iH(Int32Array,e),cH=e=>iH(Uint8Array,e),lH=e=>iH(Uint16Array,e),uH=e=>iH(Uint32Array,e),dH=e=>iH(Float32Array,e),fH=e=>iH(Float64Array,e),pH=e=>iH(Uint8ClampedArray,e);function mH(e,t){return pj(this,arguments,function*(){if(FV(t))return yield fj(yield fj(yield*mj(hj(mH(e,yield fj(t))))));let n=function(e){return pj(this,arguments,function*(){yield yield fj(yield fj(e))})},r=function(e){return pj(this,arguments,function*(){yield fj(yield*mj(hj(rH(function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)}(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof VV?n(t):IV(t)?r(t):LV(t)?t:n(t);return yield fj(yield*mj(hj(rH(function(t){return pj(this,arguments,function*(){let n=null;do n=yield fj(t.next(yield yield fj(GV(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield fj(new e)})}const hH=e=>mH(Int8Array,e),gH=e=>mH(Int16Array,e),_H=e=>mH(Int32Array,e),vH=e=>mH(Uint8Array,e),yH=e=>mH(Uint16Array,e),bH=e=>mH(Uint32Array,e),xH=e=>mH(Float32Array,e),SH=e=>mH(Float64Array,e),CH=e=>mH(Uint8ClampedArray,e);function wH(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++nPH});const NH=void 0;function PH(e){if(e===null)return`null`;if(e===NH)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>PH(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function FH(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function IH(e,t){return FH(e/t)+FH(e%t)/FH(t)}var LH={};xt(LH,{BN:()=>YH,bigNumToBigInt:()=>qH,bigNumToNumber:()=>GH,bigNumToString:()=>KH,isArrowBigNumSymbol:()=>RH});const RH=Symbol.for(`isArrowBigNum`);function zH(e,...t){return t.length===0?Object.setPrototypeOf(GV(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}zH.prototype[RH]=!0,zH.prototype.toJSON=function(){return`"${KH(this)}"`},zH.prototype.valueOf=function(e){return GH(this,e)},zH.prototype.toString=function(){return KH(this)},zH.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return GH(this);case`string`:return KH(this);case`default`:return qH(this)}return KH(this)};function BH(...e){return zH.apply(this,e)}function VH(...e){return zH.apply(this,e)}function HH(...e){return zH.apply(this,e)}Object.setPrototypeOf(BH.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(VH.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(HH.prototype,Object.create(Uint32Array.prototype)),Object.assign(BH.prototype,zH.prototype,{constructor:BH,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(VH.prototype,zH.prototype,{constructor:VH,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(HH.prototype,zH.prototype,{constructor:HH,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const UH=BigInt(4294967296)*BigInt(4294967296),WH=UH-BigInt(1);function GH(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<0){let e=BigInt(`1`.padEnd(t+1,`0`)),n=c/e,r=s?-(c%e):c%e,i=FH(n),a=`${r}`.padStart(t,`0`),o=s&&i===0?`-`:``;return+`${o}${i}.${a}`}return FH(c)}function KH(e){if(e.byteLength===8){let t=new e.BigIntArray(e.buffer,e.byteOffset,1);return`${t[0]}`}if(!e.signed)return JH(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=new Int16Array([t.at(-1)])[0];if(n>=0)return JH(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(vU.prototype);var yU=class extends vU{constructor(){super(X.Null)}toString(){return`Null`}};ZH=Symbol.toStringTag,yU[ZH]=(e=>e[Symbol.toStringTag]=`Null`)(yU.prototype);var bU=class extends vU{constructor(e,t){super(X.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};QH=Symbol.toStringTag,bU[QH]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(bU.prototype);var xU=class extends bU{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},SU=class extends bU{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},CU=class extends bU{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},wU=class extends bU{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},TU=class extends bU{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},EU=class extends bU{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},DU=class extends bU{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},OU=class extends bU{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(xU.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(SU.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(CU.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(wU.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(TU.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(EU.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(DU.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(OU.prototype,`ArrayType`,{value:BigUint64Array});var kU=class extends vU{constructor(e){super(X.Float),this.precision=e}get ArrayType(){switch(this.precision){case DH.HALF:return Uint16Array;case DH.SINGLE:return Float32Array;case DH.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};$H=Symbol.toStringTag,kU[$H]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(kU.prototype);var AU=class extends kU{constructor(){super(DH.HALF)}},jU=class extends kU{constructor(){super(DH.SINGLE)}},MU=class extends kU{constructor(){super(DH.DOUBLE)}};Object.defineProperty(AU.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(jU.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(MU.prototype,`ArrayType`,{value:Float64Array});var NU=class extends vU{constructor(){super(X.Binary)}toString(){return`Binary`}};eU=Symbol.toStringTag,NU[eU]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(NU.prototype);var PU=class extends vU{constructor(){super(X.LargeBinary)}toString(){return`LargeBinary`}};tU=Symbol.toStringTag,PU[tU]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(PU.prototype);var FU=class extends vU{constructor(){super(X.Utf8)}toString(){return`Utf8`}};nU=Symbol.toStringTag,FU[nU]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(FU.prototype);var IU=class extends vU{constructor(){super(X.LargeUtf8)}toString(){return`LargeUtf8`}};rU=Symbol.toStringTag,IU[rU]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(IU.prototype);var LU=class extends vU{constructor(){super(X.Bool)}toString(){return`Bool`}};iU=Symbol.toStringTag,LU[iU]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(LU.prototype);var RU=class extends vU{constructor(e,t,n=128){super(X.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};aU=Symbol.toStringTag,RU[aU]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(RU.prototype);var zU=class extends vU{constructor(e){super(X.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${OH[this.unit]}>`}get ArrayType(){return this.unit===OH.DAY?Int32Array:BigInt64Array}};oU=Symbol.toStringTag,zU[oU]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(zU.prototype);var BU=class extends vU{constructor(e,t){super(X.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${kH[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};sU=Symbol.toStringTag,BU[sU]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(BU.prototype);var VU=class extends vU{constructor(e,t){super(X.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${kH[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};cU=Symbol.toStringTag,VU[cU]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(VU.prototype);var HU=class extends vU{constructor(e){super(X.Interval),this.unit=e}toString(){return`Interval<${AH[this.unit]}>`}};lU=Symbol.toStringTag,HU[lU]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(HU.prototype);var UU=class extends vU{constructor(e){super(X.Duration),this.unit=e}toString(){return`Duration<${kH[this.unit]}>`}};uU=Symbol.toStringTag,UU[uU]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(UU.prototype);var WU=class extends vU{constructor(e){super(X.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};dU=Symbol.toStringTag,WU[dU]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(WU.prototype);var GU=class extends vU{constructor(e){super(X.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};fU=Symbol.toStringTag,GU[fU]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(GU.prototype);var KU=class extends vU{constructor(e,t,n){super(X.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};pU=Symbol.toStringTag,KU[pU]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(KU.prototype);var qU=class extends vU{constructor(e){super(X.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};mU=Symbol.toStringTag,qU[mU]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(qU.prototype);var JU=class extends vU{constructor(e,t){super(X.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};hU=Symbol.toStringTag,JU[hU]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(JU.prototype);var YU=class extends vU{constructor(e,t=!1){var n,r,i;if(super(X.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};gU=Symbol.toStringTag,YU[gU]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(YU.prototype);const XU=(e=>()=>++e)(-1);var ZU=class extends vU{constructor(e,t,n,r){super(X.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?XU():FH(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};_U=Symbol.toStringTag,ZU[_U]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(ZU.prototype);function QU(e){let t=e;switch(e.typeId){case X.Decimal:return e.bitWidth/32;case X.Interval:return t.unit===AH.MONTH_DAY_NANO?4:1+t.unit;case X.FixedSizeList:return t.listSize;case X.FixedSizeBinary:return t.byteWidth;default:return 1}}var $U=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return eW(this,e,t)}getVisitFnByTypeId(e,t=!0){return tW(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function eW(e,t,n=!0){return typeof t==`number`?tW(e,t,n):typeof t==`string`&&t in X?tW(e,X[t],n):t&&t instanceof vU?tW(e,nW(t),n):t?.type&&t.type instanceof vU?tW(e,nW(t.type),n):tW(e,X.NONE,n)}function tW(e,t,n=!0){let r=null;switch(t){case X.Null:r=e.visitNull;break;case X.Bool:r=e.visitBool;break;case X.Int:r=e.visitInt;break;case X.Int8:r=e.visitInt8||e.visitInt;break;case X.Int16:r=e.visitInt16||e.visitInt;break;case X.Int32:r=e.visitInt32||e.visitInt;break;case X.Int64:r=e.visitInt64||e.visitInt;break;case X.Uint8:r=e.visitUint8||e.visitInt;break;case X.Uint16:r=e.visitUint16||e.visitInt;break;case X.Uint32:r=e.visitUint32||e.visitInt;break;case X.Uint64:r=e.visitUint64||e.visitInt;break;case X.Float:r=e.visitFloat;break;case X.Float16:r=e.visitFloat16||e.visitFloat;break;case X.Float32:r=e.visitFloat32||e.visitFloat;break;case X.Float64:r=e.visitFloat64||e.visitFloat;break;case X.Utf8:r=e.visitUtf8;break;case X.LargeUtf8:r=e.visitLargeUtf8;break;case X.Binary:r=e.visitBinary;break;case X.LargeBinary:r=e.visitLargeBinary;break;case X.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case X.Date:r=e.visitDate;break;case X.DateDay:r=e.visitDateDay||e.visitDate;break;case X.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case X.Timestamp:r=e.visitTimestamp;break;case X.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case X.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case X.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case X.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case X.Time:r=e.visitTime;break;case X.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case X.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case X.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case X.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case X.Decimal:r=e.visitDecimal;break;case X.List:r=e.visitList;break;case X.Struct:r=e.visitStruct;break;case X.Union:r=e.visitUnion;break;case X.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case X.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case X.Dictionary:r=e.visitDictionary;break;case X.Interval:r=e.visitInterval;break;case X.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case X.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case X.IntervalMonthDayNano:r=e.visitIntervalMonthDayNano||e.visitInterval;break;case X.Duration:r=e.visitDuration;break;case X.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case X.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case X.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case X.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case X.FixedSizeList:r=e.visitFixedSizeList;break;case X.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${X[t]}'`)}function nW(e){switch(e.typeId){case X.Null:return X.Null;case X.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?X.Int8:X.Uint8;case 16:return n?X.Int16:X.Uint16;case 32:return n?X.Int32:X.Uint32;case 64:return n?X.Int64:X.Uint64}return X.Int}case X.Float:switch(e.precision){case DH.HALF:return X.Float16;case DH.SINGLE:return X.Float32;case DH.DOUBLE:return X.Float64}return X.Float;case X.Binary:return X.Binary;case X.LargeBinary:return X.LargeBinary;case X.Utf8:return X.Utf8;case X.LargeUtf8:return X.LargeUtf8;case X.Bool:return X.Bool;case X.Decimal:return X.Decimal;case X.Time:switch(e.unit){case kH.SECOND:return X.TimeSecond;case kH.MILLISECOND:return X.TimeMillisecond;case kH.MICROSECOND:return X.TimeMicrosecond;case kH.NANOSECOND:return X.TimeNanosecond}return X.Time;case X.Timestamp:switch(e.unit){case kH.SECOND:return X.TimestampSecond;case kH.MILLISECOND:return X.TimestampMillisecond;case kH.MICROSECOND:return X.TimestampMicrosecond;case kH.NANOSECOND:return X.TimestampNanosecond}return X.Timestamp;case X.Date:switch(e.unit){case OH.DAY:return X.DateDay;case OH.MILLISECOND:return X.DateMillisecond}return X.Date;case X.Interval:switch(e.unit){case AH.DAY_TIME:return X.IntervalDayTime;case AH.YEAR_MONTH:return X.IntervalYearMonth;case AH.MONTH_DAY_NANO:return X.IntervalMonthDayNano}return X.Interval;case X.Duration:switch(e.unit){case kH.SECOND:return X.DurationSecond;case kH.MILLISECOND:return X.DurationMillisecond;case kH.MICROSECOND:return X.DurationMicrosecond;case kH.NANOSECOND:return X.DurationNanosecond}return X.Duration;case X.Map:return X.Map;case X.List:return X.List;case X.Struct:return X.Struct;case X.Union:switch(e.mode){case EH.Dense:return X.DenseUnion;case EH.Sparse:return X.SparseUnion}return X.Union;case X.FixedSizeBinary:return X.FixedSizeBinary;case X.FixedSizeList:return X.FixedSizeList;case X.Dictionary:return X.Dictionary}throw Error(`Unrecognized type '${X[e.typeId]}'`)}$U.prototype.visitInt8=null,$U.prototype.visitInt16=null,$U.prototype.visitInt32=null,$U.prototype.visitInt64=null,$U.prototype.visitUint8=null,$U.prototype.visitUint16=null,$U.prototype.visitUint32=null,$U.prototype.visitUint64=null,$U.prototype.visitFloat16=null,$U.prototype.visitFloat32=null,$U.prototype.visitFloat64=null,$U.prototype.visitDateDay=null,$U.prototype.visitDateMillisecond=null,$U.prototype.visitTimestampSecond=null,$U.prototype.visitTimestampMillisecond=null,$U.prototype.visitTimestampMicrosecond=null,$U.prototype.visitTimestampNanosecond=null,$U.prototype.visitTimeSecond=null,$U.prototype.visitTimeMillisecond=null,$U.prototype.visitTimeMicrosecond=null,$U.prototype.visitTimeNanosecond=null,$U.prototype.visitDenseUnion=null,$U.prototype.visitSparseUnion=null,$U.prototype.visitIntervalDayTime=null,$U.prototype.visitIntervalYearMonth=null,$U.prototype.visitIntervalMonthDayNano=null,$U.prototype.visitDuration=null,$U.prototype.visitDurationSecond=null,$U.prototype.visitDurationMillisecond=null,$U.prototype.visitDurationMicrosecond=null,$U.prototype.visitDurationNanosecond=null;var rW={};xt(rW,{float64ToUint16:()=>sW,uint16ToFloat64:()=>oW});const iW=new Float64Array(1),aW=new Uint32Array(iW.buffer);function oW(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function sW(e){if(e!==e)return 32256;iW[0]=e;let t=(aW[1]&2147483648)>>16&65535,n=aW[1]&2146435072,r=0;return n>=1089470464?aW[0]>0?n=31744:(n=(n&2080374784)>>16,r=(aW[1]&1048575)>>10):n<=1056964608?(r=1048576+(aW[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(aW[1]&1048575)+512>>10),t|n|r&65535}var cW=class extends $U{};function lW(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const uW=(e,t,n)=>{e[t]=Math.floor(n/864e5)},dW=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},mW=({values:e},t,n)=>{e[t]=n},hW=({values:e},t,n)=>{e[t]=sW(n)},gW=(e,t,n)=>{switch(e.type.precision){case DH.HALF:return hW(e,t,n);case DH.SINGLE:case DH.DOUBLE:return mW(e,t,n)}},_W=({values:e},t,n)=>{uW(e,t,n.valueOf())},vW=({values:e},t,n)=>{e[t]=BigInt(n)},yW=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},bW=({values:e,valueOffsets:t},n,r)=>dW(e,t,n,r),xW=({values:e,valueOffsets:t},n,r)=>dW(e,t,n,MV(r)),SW=(e,t,n)=>{e.type.unit===OH.DAY?_W(e,t,n):vW(e,t,n)},CW=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},wW=({values:e},t,n)=>{e[t]=BigInt(n)},TW=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},EW=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},DW=(e,t,n)=>{switch(e.type.unit){case kH.SECOND:return CW(e,t,n);case kH.MILLISECOND:return wW(e,t,n);case kH.MICROSECOND:return TW(e,t,n);case kH.NANOSECOND:return EW(e,t,n)}},OW=({values:e},t,n)=>{e[t]=n},kW=({values:e},t,n)=>{e[t]=n},AW=({values:e},t,n)=>{e[t]=n},jW=({values:e},t,n)=>{e[t]=n},MW=(e,t,n)=>{switch(e.type.unit){case kH.SECOND:return OW(e,t,n);case kH.MILLISECOND:return kW(e,t,n);case kH.MICROSECOND:return AW(e,t,n);case kH.NANOSECOND:return jW(e,t,n)}},NW=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},PW=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=tG.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=tG.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},IW=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),LW=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),RW=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),zW=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),BW=(e,t,n)=>{let r=e.type.children.map(e=>tG.getVisitFn(e.type)),i=n instanceof Map?RW(t,n):n instanceof iq?LW(t,n):Array.isArray(n)?IW(t,n):zW(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},VW=(e,t,n)=>{e.type.mode===EH.Dense?HW(e,t,n):UW(e,t,n)},HW=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];tG.visit(i,e.valueOffsets[t],n)},UW=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];tG.visit(i,t,n)},WW=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},GW=(e,t,n)=>{switch(e.type.unit){case AH.YEAR_MONTH:return qW(e,t,n);case AH.DAY_TIME:return KW(e,t,n);case AH.MONTH_DAY_NANO:return JW(e,t,n)}},KW=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},qW=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},JW=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},YW=({values:e},t,n)=>{e[t]=n},XW=({values:e},t,n)=>{e[t]=n},ZW=({values:e},t,n)=>{e[t]=n},QW=({values:e},t,n)=>{e[t]=n},$W=(e,t,n)=>{switch(e.type.unit){case kH.SECOND:return YW(e,t,n);case kH.MILLISECOND:return XW(e,t,n);case kH.MICROSECOND:return ZW(e,t,n);case kH.NANOSECOND:return QW(e,t,n)}},eG=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=tG.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${PH(e)}: ${PH(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new aG(this[nG],this[rG])}},aG=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[nG].type.children.some(e=>e.name===t)}getOwnPropertyDescriptor(e,t){if(e[nG].type.children.some(e=>e.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[nG].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=$G.visit(e[nG].children[n],e[rG]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[nG].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(tG.visit(e[nG].children[r],e[rG],n),Reflect.set(e,t,n))}};const sG=new oG;var cG=class extends $U{};function lG(e){return(t,n)=>t.getValid(n)?e(t,n):null}const uG=(e,t)=>864e5*e[t],dG=(e,t)=>null,fG=(e,t,n)=>{if(n+1>=t.length)return null;let r=FH(t[n]),i=FH(t[n+1]);return e.subarray(r,i)},pG=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<uG(e,t),hG=({values:e},t)=>FH(e[t]),gG=({stride:e,values:t},n)=>t[e*n],_G=({stride:e,values:t},n)=>oW(t[e*n]),vG=({values:e},t)=>e[t],yG=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),bG=({values:e,valueOffsets:t},n)=>fG(e,t,n),xG=({values:e,valueOffsets:t},n)=>{let r=fG(e,t,n);return r===null?null:AV(r)},SG=({values:e},t)=>e[t],CG=({type:e,values:t},n)=>e.precision===DH.HALF?oW(t[n]):t[n],wG=(e,t)=>e.type.unit===OH.DAY?mG(e,t):hG(e,t),TG=({values:e},t)=>1e3*FH(e[t]),EG=({values:e},t)=>FH(e[t]),DG=({values:e},t)=>IH(e[t],BigInt(1e3)),OG=({values:e},t)=>IH(e[t],BigInt(1e6)),kG=(e,t)=>{switch(e.type.unit){case kH.SECOND:return TG(e,t);case kH.MILLISECOND:return EG(e,t);case kH.MICROSECOND:return DG(e,t);case kH.NANOSECOND:return OG(e,t)}},AG=({values:e},t)=>e[t],jG=({values:e},t)=>e[t],MG=({values:e},t)=>e[t],NG=({values:e},t)=>e[t],PG=(e,t)=>{switch(e.type.unit){case kH.SECOND:return AG(e,t);case kH.MILLISECOND:return jG(e,t);case kH.MICROSECOND:return MG(e,t);case kH.NANOSECOND:return NG(e,t)}},FG=({values:e,stride:t},n)=>YH.decimal(e.subarray(t*n,t*(n+1))),IG=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new iq([c])},LG=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new iK(o.slice(i,a-i))},RG=(e,t)=>new iG(e,t),zG=(e,t)=>e.type.mode===EH.Dense?BG(e,t):VG(e,t),BG=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return $G.visit(r,e.valueOffsets[t])},VG=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return $G.visit(r,t)},HG=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},UG=(e,t)=>e.type.unit===AH.MONTH_DAY_NANO?KG(e,t):e.type.unit===AH.DAY_TIME?WG(e,t):GG(e,t),WG=({values:e},t)=>e.subarray(2*t,2*(t+1)),GG=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},KG=({values:e},t)=>e.subarray(4*t,4*(t+1)),qG=({values:e},t)=>e[t],JG=({values:e},t)=>e[t],YG=({values:e},t)=>e[t],XG=({values:e},t)=>e[t],ZG=(e,t)=>{switch(e.type.unit){case kH.SECOND:return qG(e,t);case kH.MILLISECOND:return JG(e,t);case kH.MICROSECOND:return YG(e,t);case kH.NANOSECOND:return XG(e,t)}},QG=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new iq([a])};cG.prototype.visitNull=lG(dG),cG.prototype.visitBool=lG(pG),cG.prototype.visitInt=lG(SG),cG.prototype.visitInt8=lG(gG),cG.prototype.visitInt16=lG(gG),cG.prototype.visitInt32=lG(gG),cG.prototype.visitInt64=lG(vG),cG.prototype.visitUint8=lG(gG),cG.prototype.visitUint16=lG(gG),cG.prototype.visitUint32=lG(gG),cG.prototype.visitUint64=lG(vG),cG.prototype.visitFloat=lG(CG),cG.prototype.visitFloat16=lG(_G),cG.prototype.visitFloat32=lG(gG),cG.prototype.visitFloat64=lG(gG),cG.prototype.visitUtf8=lG(xG),cG.prototype.visitLargeUtf8=lG(xG),cG.prototype.visitBinary=lG(bG),cG.prototype.visitLargeBinary=lG(bG),cG.prototype.visitFixedSizeBinary=lG(yG),cG.prototype.visitDate=lG(wG),cG.prototype.visitDateDay=lG(mG),cG.prototype.visitDateMillisecond=lG(hG),cG.prototype.visitTimestamp=lG(kG),cG.prototype.visitTimestampSecond=lG(TG),cG.prototype.visitTimestampMillisecond=lG(EG),cG.prototype.visitTimestampMicrosecond=lG(DG),cG.prototype.visitTimestampNanosecond=lG(OG),cG.prototype.visitTime=lG(PG),cG.prototype.visitTimeSecond=lG(AG),cG.prototype.visitTimeMillisecond=lG(jG),cG.prototype.visitTimeMicrosecond=lG(MG),cG.prototype.visitTimeNanosecond=lG(NG),cG.prototype.visitDecimal=lG(FG),cG.prototype.visitList=lG(IG),cG.prototype.visitStruct=lG(RG),cG.prototype.visitUnion=lG(zG),cG.prototype.visitDenseUnion=lG(BG),cG.prototype.visitSparseUnion=lG(VG),cG.prototype.visitDictionary=lG(HG),cG.prototype.visitInterval=lG(UG),cG.prototype.visitIntervalDayTime=lG(WG),cG.prototype.visitIntervalYearMonth=lG(GG),cG.prototype.visitIntervalMonthDayNano=lG(KG),cG.prototype.visitDuration=lG(ZG),cG.prototype.visitDurationSecond=lG(qG),cG.prototype.visitDurationMillisecond=lG(JG),cG.prototype.visitDurationMicrosecond=lG(YG),cG.prototype.visitDurationNanosecond=lG(XG),cG.prototype.visitFixedSizeList=lG(QG),cG.prototype.visitMap=lG(LG);const $G=new cG,eK=Symbol.for(`keys`),tK=Symbol.for(`vals`),nK=Symbol.for(`kKeysAsStrings`),rK=Symbol.for(`_kKeysAsStrings`);var iK=class{constructor(e){return this[eK]=new iq([e.children[0]]).memoize(),this[tK]=e.children[1],new Proxy(this,new oK)}get[nK](){return this[rK]||(this[rK]=Array.from(this[eK].toArray(),String))}[Symbol.iterator](){return new aK(this[eK],this[tK])}get size(){return this[eK].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[eK],t=this[tK],n={};for(let r=-1,i=e.length;++r`${PH(e)}: ${PH(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},aK=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),$G.visit(this.vals,e)]})}},oK=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[nK]}has(e,t){return e[nK].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[nK].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[nK].indexOf(t);if(n!==-1){let r=$G.visit(Reflect.get(e,tK),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[nK].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(tG.visit(Reflect.get(e,tK),r,n),Reflect.set(e,t,n))}};Object.defineProperties(iK.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[eK]:{writable:!0,enumerable:!1,configurable:!1,value:null},[tK]:{writable:!0,enumerable:!1,configurable:!1,value:null},[rK]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var sK={};xt(sK,{clampRange:()=>lK,createElementComparator:()=>fK,wrapIndex:()=>uK});let cK;function lK(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const uK=(e,t)=>e<0?t+e:e,dK=e=>e!==e;function fK(e){let t=typeof e;if(t!==`object`||e===null)return dK(e)?dK:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?TH(e,t):!1:e instanceof Map?mK(e):Array.isArray(e)?pK(e):e instanceof iq?hK(e):gK(e,!0)}function pK(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return vK(e,n);case Map:return bK(e,n,n.keys());case iK:case iG:case Object:case void 0:return bK(e,n,t||Object.keys(n))}return n instanceof iq?yK(e,n):!1}}function vK(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++rDK,getBit:()=>CK,getBool:()=>SK,packBools:()=>EK,popcnt_array:()=>kK,popcnt_bit_range:()=>OK,popcnt_uint32:()=>AK,setBool:()=>wK,truncateBitmap:()=>TK});function SK(e,t,n,r){return(n&1<>r}function wK(e,t,n){return n?!!(e[t>>3]|=1<>3]&=~(1<0||n.byteLength>3):EK(new DK(n,e,t,null,SK)).subarray(0,r)),i}return n}function EK(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var DK=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return OK(e,t,i)+OK(e,r,n)+kK(e,i>>3,r-i>>3)}function kK(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=AK(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=AK(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=AK(a.getUint8(i)),i+=1;return r}function AK(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const jK=-1;var MK=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return vU.isSparseUnion(e)||vU.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(vU.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=jK&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-OK(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=QU(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(vU.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===EH.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(TK(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===X.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(TK(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[jH.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[jH.TYPE])&&(a[jH.TYPE]=i.subarray(e,e+t)),(i=a[jH.OFFSET])&&(a[jH.OFFSET]=i.subarray(e,e+t+1))||(i=a[jH.DATA])&&(a[jH.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};MK.prototype.children=Object.freeze([]);var NK=class e extends $U{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new MK(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=XV(e.data),i=XV(e.nullBitmap),a=JV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=XV(e.data),i=XV(e.nullBitmap),a=YV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=XV(e.data),i=XV(e.nullBitmap),a=JV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=XV(e.data),i=XV(e.nullBitmap),a=YV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=XV(e.nullBitmap),a=JV(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new MK(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=XV(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=GV(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(vU.isSparseUnion(t))return new MK(t,n,a,o,[void 0,void 0,void 0,i],r);let s=JV(e.valueOffsets);return new MK(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=XV(t.nullBitmap),a=GV(n.indices.ArrayType,t.data),{dictionary:o=new iq([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new MK(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length/QU(t),nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=XV(e.nullBitmap),i=GV(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new MK(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=XV(t.nullBitmap),{length:o=i.length/QU(n),nullCount:s=t.nullBitmap?-1:0}=t;return new MK(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=XV(t.nullBitmap),o=JV(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new MK(n,r,s,c,[o,void 0,a],[i])}};const PK=new NK;var FK=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function LK(e){return e.reduce((e,t)=>e+t.nullCount,0)}function RK(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function zK(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function BK(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function qK(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new DK(n,e.offset+(t||0),e.length,n,SK)){if(!i)return r;++r}return-1}function JK(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case X.Union:break;case X.Dictionary:break;default:return qK(e,n)}let r=$G.getVisitFn(e),i=fK(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new FK(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new $K(a)})}var $K=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof MK)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=nq[o.typeId],r=a[0];this.isValid=e=>VK(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,rq[o.typeId]),this._offsets=RK(a);break}this.data=a,this.type=o,this.stride=QU(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return IK(this.data)}get nullCount(){return LK(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${X[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(uK(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return eq.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(lK(this,t,n,({data:e,_offsets:t},n,r)=>zK(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case X.Int:case X.Float:case X.Decimal:case X.Time:case X.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return vU.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(vU.isDictionary(this.type)){let t=new aq(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new aq(this)}unmemoize(){if(vU.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};tq=Symbol.toStringTag,iq[tq]=(e=>{e.type=vU.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(X).map(e=>X[e]).filter(e=>typeof e==`number`&&e!==X.NONE);for(let n of t){let t=$G.getVisitFnByTypeId(n),r=tG.getVisitFnByTypeId(n),i=XK.getVisitFnByTypeId(n);nq[n]={get:t,set:r,indexOf:i},rq[n]=Object.create(e,{isValid:{value:HK(VK)},get:{value:HK($G.getVisitFnByTypeId(n))},set:{value:UK(tG.getVisitFnByTypeId(n))},indexOf:{value:WK(XK.getVisitFnByTypeId(n))}})}return`Vector`})(iq.prototype);var aq=class e extends iq{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new iq(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},oq={};xt(oq,{BaseInt64:()=>dq,Int128:()=>mq,Int64:()=>pq,Uint64:()=>fq});const sq=65536;function cq(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const lq=8,uq=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];var dq=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${cq(this.buffer[3])} ${cq(this.buffer[2])} ${cq(this.buffer[1])} ${cq(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;ngq,toIntervalDayTimeObjects:()=>vq,toIntervalMonthDayNanoInt32Array:()=>_q,toIntervalMonthDayNanoObjects:()=>yq});function gq(e){var t,n;let r=e.length,i=new Int32Array(r*2);for(let a=0,o=0;a>BigInt(32))):o+=2}return i}function vq(e){let t=e.length,n=Array(t/2);for(let r=0,i=0;r>>0);r[a++]={months:e[i],days:e[i+1],nanoseconds:t?`${n}`:n}}return r}var bq=class extends $U{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function xq(e,t){return t instanceof e.constructor}function Sq(e,t){return e===t||xq(e,t)}function Cq(e,t){return e===t||xq(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function wq(e,t){return e===t||xq(e,t)&&e.precision===t.precision}function Tq(e,t){return e===t||xq(e,t)&&e.byteWidth===t.byteWidth}function Eq(e,t){return e===t||xq(e,t)&&e.unit===t.unit}function Dq(e,t){return e===t||xq(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Oq(e,t){return e===t||xq(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function kq(e,t){return e===t||xq(e,t)&&e.children.length===t.children.length&&Lq.compareManyFields(e.children,t.children)}function Aq(e,t){return e===t||xq(e,t)&&e.children.length===t.children.length&&Lq.compareManyFields(e.children,t.children)}function jq(e,t){return e===t||xq(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&Lq.compareManyFields(e.children,t.children)}function Mq(e,t){return e===t||xq(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Lq.visit(e.indices,t.indices)&&Lq.visit(e.dictionary,t.dictionary)}function Nq(e,t){return e===t||xq(e,t)&&e.unit===t.unit}function Pq(e,t){return e===t||xq(e,t)&&e.unit===t.unit}function Fq(e,t){return e===t||xq(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Lq.compareManyFields(e.children,t.children)}function Iq(e,t){return e===t||xq(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Lq.compareManyFields(e.children,t.children)}bq.prototype.visitNull=Sq,bq.prototype.visitBool=Sq,bq.prototype.visitInt=Cq,bq.prototype.visitInt8=Cq,bq.prototype.visitInt16=Cq,bq.prototype.visitInt32=Cq,bq.prototype.visitInt64=Cq,bq.prototype.visitUint8=Cq,bq.prototype.visitUint16=Cq,bq.prototype.visitUint32=Cq,bq.prototype.visitUint64=Cq,bq.prototype.visitFloat=wq,bq.prototype.visitFloat16=wq,bq.prototype.visitFloat32=wq,bq.prototype.visitFloat64=wq,bq.prototype.visitUtf8=Sq,bq.prototype.visitLargeUtf8=Sq,bq.prototype.visitBinary=Sq,bq.prototype.visitLargeBinary=Sq,bq.prototype.visitFixedSizeBinary=Tq,bq.prototype.visitDate=Eq,bq.prototype.visitDateDay=Eq,bq.prototype.visitDateMillisecond=Eq,bq.prototype.visitTimestamp=Dq,bq.prototype.visitTimestampSecond=Dq,bq.prototype.visitTimestampMillisecond=Dq,bq.prototype.visitTimestampMicrosecond=Dq,bq.prototype.visitTimestampNanosecond=Dq,bq.prototype.visitTime=Oq,bq.prototype.visitTimeSecond=Oq,bq.prototype.visitTimeMillisecond=Oq,bq.prototype.visitTimeMicrosecond=Oq,bq.prototype.visitTimeNanosecond=Oq,bq.prototype.visitDecimal=Sq,bq.prototype.visitList=kq,bq.prototype.visitStruct=Aq,bq.prototype.visitUnion=jq,bq.prototype.visitDenseUnion=jq,bq.prototype.visitSparseUnion=jq,bq.prototype.visitDictionary=Mq,bq.prototype.visitInterval=Nq,bq.prototype.visitIntervalDayTime=Nq,bq.prototype.visitIntervalYearMonth=Nq,bq.prototype.visitIntervalMonthDayNano=Nq,bq.prototype.visitDuration=Pq,bq.prototype.visitDurationSecond=Pq,bq.prototype.visitDurationMillisecond=Pq,bq.prototype.visitDurationMicrosecond=Pq,bq.prototype.visitDurationNanosecond=Pq,bq.prototype.visitFixedSizeList=Fq,bq.prototype.visitMap=Iq;const Lq=new bq;function Rq(e,t){return Lq.compareSchemas(e,t)}function zq(e,t){return Lq.compareFields(e,t)}function Bq(e,t){return Lq.visit(e,t)}const Vq=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},LH),oq),xK),rW),BV),sK),MH),hq),{compareSchemas:Rq,compareFields:zq,compareTypes:Bq}),Hq=365.2425,Uq=10**8*24*60*60*1e3,Wq=6048e5,Gq=864e5,Kq=3600,qq=Kq*24,Jq=qq*7,Yq=qq*Hq,Xq=Yq/12,Zq=Xq*3,Qq=Symbol.for(`constructDateFrom`);function $q(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Qq in e?e[Qq](t):e instanceof Date?new e.constructor(t):new Date(t)}function eJ(e,t){return $q(t||e,e)}let tJ={};function nJ(){return tJ}function rJ(e,t){var n,r;let i=nJ(),a=t?.weekStartsOn??(t==null||(n=t.locale)==null||(n=n.options)==null?void 0:n.weekStartsOn)??i.weekStartsOn??((r=i.locale)==null||(r=r.options)==null?void 0:r.weekStartsOn)??0,o=eJ(e,t?.in),s=o.getDay(),c=(s=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function oJ(e){let t=eJ(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function sJ(e,...t){let n=$q.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function cJ(e,t){let n=eJ(e,t?.in);return n.setHours(0,0,0,0),n}function lJ(e,t,n){let[r,i]=sJ(n?.in,e,t),a=cJ(r),o=cJ(i),s=+a-oJ(a),c=+o-oJ(o);return Math.round((s-c)/Gq)}function uJ(e,t){let n=aJ(e,t),r=$q(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),iJ(r)}function dJ(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function fJ(e){return!(!dJ(e)&&typeof e!=`number`||isNaN(+eJ(e)))}function pJ(e,t){let n=eJ(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const mJ={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`}},hJ=(e,t,n)=>{let r,i=mJ[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function gJ(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}const _J={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},vJ={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},yJ={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},bJ={date:gJ({formats:_J,defaultWidth:`full`}),time:gJ({formats:vJ,defaultWidth:`full`}),dateTime:gJ({formats:yJ,defaultWidth:`full`})},xJ={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},SJ=(e,t,n,r)=>xJ[e];function CJ(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const wJ={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},TJ={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},EJ={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`]},DJ={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`]},OJ={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`}},kJ={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`}},AJ=(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},jJ={ordinalNumber:AJ,era:CJ({values:wJ,defaultWidth:`wide`}),quarter:CJ({values:TJ,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:CJ({values:EJ,defaultWidth:`wide`}),day:CJ({values:DJ,defaultWidth:`wide`}),dayPeriod:CJ({values:OJ,defaultWidth:`wide`,formattingValues:kJ,defaultFormattingWidth:`wide`})};function MJ(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?PJ(s,e=>e.test(o)):NJ(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function NJ(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function PJ(e,t){for(let n=0;n{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const IJ=/^(\d+)(th|st|nd|rd)?/i,LJ=/\d+/i,RJ={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},zJ={any:[/^b/i,/^(a|c)/i]},BJ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},VJ={any:[/1/i,/2/i,/3/i,/4/i]},HJ={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},UJ={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]},WJ={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},GJ={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]},KJ={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},qJ={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}},JJ={ordinalNumber:FJ({matchPattern:IJ,parsePattern:LJ,valueCallback:e=>parseInt(e,10)}),era:MJ({matchPatterns:RJ,defaultMatchWidth:`wide`,parsePatterns:zJ,defaultParseWidth:`any`}),quarter:MJ({matchPatterns:BJ,defaultMatchWidth:`wide`,parsePatterns:VJ,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:MJ({matchPatterns:HJ,defaultMatchWidth:`wide`,parsePatterns:UJ,defaultParseWidth:`any`}),day:MJ({matchPatterns:WJ,defaultMatchWidth:`wide`,parsePatterns:GJ,defaultParseWidth:`any`}),dayPeriod:MJ({matchPatterns:KJ,defaultMatchWidth:`any`,parsePatterns:qJ,defaultParseWidth:`any`})},YJ={code:`en-US`,formatDistance:hJ,formatLong:bJ,formatRelative:SJ,localize:jJ,match:JJ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function XJ(e,t){let n=eJ(e,t?.in),r=lJ(n,pJ(n)),i=r+1;return i}function ZJ(e,t){let n=eJ(e,t?.in),r=iJ(n)-+uJ(n);return Math.round(r/Wq)+1}function QJ(e,t){var n,r;let i=eJ(e,t?.in),a=i.getFullYear(),o=nJ(),s=t?.firstWeekContainsDate??(t==null||(n=t.locale)==null||(n=n.options)==null?void 0:n.firstWeekContainsDate)??o.firstWeekContainsDate??((r=o.locale)==null||(r=r.options)==null?void 0:r.firstWeekContainsDate)??1,c=$q(t?.in||e,0);c.setFullYear(a+1,0,s),c.setHours(0,0,0,0);let l=rJ(c,t),u=$q(t?.in||e,0);u.setFullYear(a,0,s),u.setHours(0,0,0,0);let d=rJ(u,t);return+i>=+l?a+1:+i>=+d?a:a-1}function $J(e,t){var n,r;let i=nJ(),a=t?.firstWeekContainsDate??(t==null||(n=t.locale)==null||(n=n.options)==null?void 0:n.firstWeekContainsDate)??i.firstWeekContainsDate??((r=i.locale)==null||(r=r.options)==null?void 0:r.firstWeekContainsDate)??1,o=QJ(e,t),s=$q(t?.in||e,0);s.setFullYear(o,0,a),s.setHours(0,0,0,0);let c=rJ(s,t);return c}function eY(e,t){let n=eJ(e,t?.in),r=rJ(n,t)-+$J(n,t);return Math.round(r/Wq)+1}function tY(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString().padStart(t,`0`);return n+r}const nY={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return tY(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):tY(n+1,2)},d(e,t){return tY(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];case`aaaa`:default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return tY(e.getHours()%12||12,t.length)},H(e,t){return tY(e.getHours(),t.length)},m(e,t){return tY(e.getMinutes(),t.length)},s(e,t){return tY(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*10**(n-3));return tY(i,t.length)}},rY={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},iY={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});case`GGGG`:default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return nY.y(e,t)},Y:function(e,t,n,r){let i=QJ(e,r),a=i>0?i:1-i;if(t===`YY`){let e=a%100;return tY(e,2)}return t===`Yo`?n.ordinalNumber(a,{unit:`year`}):tY(a,t.length)},R:function(e,t){let n=aJ(e);return tY(n,t.length)},u:function(e,t){let n=e.getFullYear();return tY(n,t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return tY(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return tY(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return nY.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return tY(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=eY(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):tY(i,t.length)},I:function(e,t,n){let r=ZJ(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):tY(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):nY.d(e,t)},D:function(e,t,n){let r=XJ(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):tY(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});case`EEEE`:default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return tY(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});case`eeee`:default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return tY(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});case`cccc`:default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return tY(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});case`iiii`:default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours(),i=r/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?rY.noon:r===0?rY.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?rY.evening:r>=12?rY.afternoon:r>=4?rY.morning:rY.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return nY.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):nY.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):tY(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):tY(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):nY.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):nY.s(e,t)},S:function(e,t){return nY.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return oY(r);case`XXXX`:case`XX`:return sY(r);case`XXXXX`:case`XXX`:default:return sY(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return oY(r);case`xxxx`:case`xx`:return sY(r);case`xxxxx`:case`xxx`:default:return sY(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+aY(r,`:`);case`OOOO`:default:return`GMT`+sY(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+aY(r,`:`);case`zzzz`:default:return`GMT`+sY(r,`:`)}},t:function(e,t,n){let r=Math.trunc(e/1e3);return tY(r,t.length)},T:function(e,t,n){return tY(+e,t.length)}};function aY(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+tY(a,2)}function oY(e,t){if(e%60==0){let t=e>0?`-`:`+`;return t+tY(Math.abs(e)/60,2)}return sY(e,t)}function sY(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=tY(Math.trunc(r/60),2),a=tY(r%60,2);return n+i+t+a}const cY=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});case`PPPP`:default:return t.date({width:`full`})}},lY=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});case`pppp`:default:return t.time({width:`full`})}},uY=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return cY(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;case`PPPP`:default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,cY(r,t)).replace(`{{time}}`,lY(i,t))},dY={p:lY,P:uY},fY=/^D+$/,pY=/^Y+$/,mY=[`D`,`DD`,`YY`,`YYYY`];function hY(e){return fY.test(e)}function gY(e){return pY.test(e)}function _Y(e,t,n){let r=vY(e,t,n);if(console.warn(r),mY.includes(e))throw RangeError(r)}function vY(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const yY=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bY=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xY=/^'([^]*?)'?$/,SY=/''/g,CY=/[a-zA-Z]/;function wY(e,t,n){var r,i,a,o;let s=nJ(),c=n?.locale??s.locale??YJ,l=n?.firstWeekContainsDate??(n==null||(r=n.locale)==null||(r=r.options)==null?void 0:r.firstWeekContainsDate)??s.firstWeekContainsDate??((i=s.locale)==null||(i=i.options)==null?void 0:i.firstWeekContainsDate)??1,u=n?.weekStartsOn??(n==null||(a=n.locale)==null||(a=a.options)==null?void 0:a.weekStartsOn)??s.weekStartsOn??((o=s.locale)==null||(o=o.options)==null?void 0:o.weekStartsOn)??0,d=eJ(e,n?.in);if(!fJ(d))throw RangeError(`Invalid time value`);let f=t.match(bY).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=dY[t];return n(e,c.formatLong)}return e}).join(``).match(yY).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:TY(e)};if(iY[t])return{isToken:!0,value:e};if(t.match(CY))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});c.localize.preprocessor&&(f=c.localize.preprocessor(d,f));let p={firstWeekContainsDate:l,weekStartsOn:u,locale:c};return f.map(r=>{if(!r.isToken)return r.value;let i=r.value;(!n?.useAdditionalWeekYearTokens&&gY(i)||!n?.useAdditionalDayOfYearTokens&&hY(i))&&_Y(i,t,String(e));let a=iY[i[0]];return a(d,i,c.localize,p)}).join(``)}function TY(e){let t=e.match(xY);return t?t[1].replace(SY,`'`):e}function EY(e,t){return eJ(e*1e3,t?.in)}function DY(e,t){let n=OY(t)?new t(0):$q(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function OY(e){var t;return typeof e==`function`&&(t=e.prototype)?.constructor===e}function kY(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function AY(e){return e==null}function jY(e){return e!=null}async function MY(){if(typeof window<`u`&&window!==null)return`browser`;try{let e=await Et(()=>import(`./__vite-browser-external-Dxcx6a0k.js`).then(wt(1)),__vite__mapDeps([0,1,2,3]));return e!==void 0&&e.versions!=null&&e.versions.node!=null?`node`:`unknown`}catch{return`unknown`}}function NY(e){return AY(e)?!1:vU.isInt(e.type)&&!zY(e)||PY(e)}function PY(e){return AY(e)?!1:vU.isInt(e.type)&&e.type.isSigned===!1}function FY(e){return AY(e)?!1:vU.isFloat(e.type)??!1}function IY(e){return AY(e)?!1:vU.isDecimal(e.type)}function LY(e){return AY(e)?!1:vU.isBool(e.type)}function RY(e){return AY(e)?!1:vU.isDuration(e.type)}function zY(e){return AY(e)?!1:vU.isInt(e.type)&&e.metadata.get(`ARROW:extension:name`)===`period`}function BY(e){return AY(e)?!1:vU.isTimestamp(e.type)}function VY(e){return AY(e)?!1:vU.isDate(e.type)}function HY(e){return AY(e)?!1:vU.isTime(e.type)}function UY(e){return AY(e)?!1:vU.isList(e.type)||vU.isFixedSizeList(e.type)}function WY(e){return AY(e)?!1:vU.isStruct(e.type)||vU.isMap(e.type)}function GY(e){return AY(e)?!1:vU.isStruct(e.type)&&e.metadata.get(`ARROW:extension:name`)===`interval`||vU.isInterval(e.type)}const KY=new Date(1970,0,1);function qY(e,t){let n;if(t===kH.MILLISECOND)n=1e3;else if(t===kH.MICROSECOND)n=1e3*1e3;else if(t===kH.NANOSECOND)n=1e3*1e3*1e3;else return Number(e);return typeof e==`bigint`&&!Number.isSafeInteger(Number(e))?Number(e/BigInt(n)):Number(e)/n}function JY(e,t){var n;let r=qY(e,(t==null||(n=t.type)==null?void 0:n.unit)??kH.SECOND);return EY(r)}function YY(e,t){let n=JY(e,t);return wY(n,n.getMilliseconds()===0?`HH:mm:ss`:`HH:mm:ss.SSS`)}function XY(e){let t=`yyyy-MM-dd`;return e instanceof Date||typeof e==`number`&&Number.isFinite(e)?wY(e,t):(console.warn(`Unsupported date value: ${e}`),String(e))}function ZY(e,t){var n;if(!(e instanceof Date||typeof e==`number`&&Number.isFinite(e)))return console.warn(`Unsupported datetime value: ${e}`),null;let r,i=t==null||(n=t.type)==null?void 0:n.timezone;return r=i?new SV(e,i):new SV(e),DY(r,Date)}function QY(e,t){var n;let r=(t==null||(n=t.type)==null?void 0:n.scale)||0,i=Vq.bigNumToString(new Vq.BN(e)).padStart(r,`0`);if(r===0)return i;let a=``;i.startsWith(`-`)&&(a=`-`,i=i.slice(1));let o=i.slice(0,-r)||`0`,s=kY(i.slice(-r),`0`)||``;return`${a}${o}${s?`.${s}`:``}`}const $Y=new Intl.NumberFormat(`en-US`,{style:`decimal`,maximumFractionDigits:4,minimumFractionDigits:4,useGrouping:!0});function eX(e){let t=e[0],n=e[1],r=[];return t!==0&&r.push(`${t} year${t>1?`s`:``}`),n!==0&&r.push(`${n} month${n>1?`s`:``}`),r.length?r.join(` `):`0 months`}function tX(e,t){if(vU.isInterval(t?.type))return eX(e);let n=t&&t.metadata.get(`ARROW:extension:name`);if(n&&n===`pandas.interval`){var r,i;let n=JSON.parse(t.metadata.get(`ARROW:extension:metadata`)),{closed:a}=n,o=e.toJSON(),s=a===`both`||a===`left`?`[`:`(`,c=a===`both`||a===`right`?`]`:`)`,l=rX(o.left,(r=t.type)==null||(r=r.children)==null?void 0:r[0]),u=rX(o.right,(i=t.type)==null||(i=i.children)==null?void 0:i[1]);return`${s+l}, ${u+c}`}return String(e)}function nX(e,t){return t?.type instanceof GU?JSON.parse(JSON.stringify(e,(e,t)=>{if(jY(t))return typeof t==`bigint`?Number(t):t})):JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t))}function rX(e,t){if(AY(e))return null;let n=e instanceof Date||Number.isFinite(e);if(n&&VY(t))return XY(e);if(typeof e==`bigint`&&HY(t))return YY(Number(e),t);if(n&&BY(t))return ZY(e,t);if(zY(t))throw Error(`Period type is not supported yet`);if(GY(t))return tX(e,t);if(RY(t))throw Error(`Duration type is not supported yet`);return IY(t)?QY(e,t):FY(t)&&Number.isFinite(e)||NY(t)?e:WY(t)||UY(t)?nX(e,t):LY(t)?!!e:String(e)}function iX(e){let t=(e.toArray()||[]).map(e=>e.toJSON())||[],n=t.map(t=>(e.schema.fields.forEach(e=>t[e.name]=rX(t[e.name],e)),t));return n}let aX=function(e){return e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e}({});async function oX(e){let t=Nt(e,{logger:!1}),n,r,i=await MY();if(i===`browser`){if(t.bundles===void 0){let{getBundles:e}=await Et(async()=>{let{getBundles:e}=await import(`./default-browser-DTRWbcB3.js`);return{getBundles:e}},[]);t.bundles=await e()}r=await mV(await t.bundles),n=new Worker(r.mainWorker)}else if(i===`node`){if(t.bundles===void 0){let{getBundles:e}=await Et(async()=>{let{getBundles:e}=await import(`./default-node-q82Mf43j.js`);return{getBundles:e}},__vite__mapDeps([4,2,3]));t.bundles=await e()}r=await mV(await t.bundles);let e=r.mainWorker;e.startsWith(`/@fs/`)&&(e=e.replace(`/@fs/`,`file://`));let i=await Et(()=>import(`./browser-CMSJHaBF.js`),[]);n=new i.default(e,{type:`module`})}else throw Error(`Unsupported environment: ${i}`);let a;a=t.logger===!0?new MB:t.logger===!1?new jB:t.logger;let o=new UB(a,n);if(await o.instantiate(r.mainModule,r.pthreadWorker),t.storage)switch(t.storage.type){case aX.ORIGIN_PRIVATE_FS:try{let e=t.storage.path;e.startsWith(`/`)&&(e=e.slice(1)),await o.open({path:`opfs://${e}`,accessMode:t.storage.accessMode})}catch(e){throw await o.terminate(),await n.terminate(),e}break;case aX.NODE_FS:try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(e){throw await o.terminate(),await n.terminate(),e}break}let s=await o.connect();async function c(e,t=[]){if(!t||t.length===0){let t=await s.query(e);return{_results:t,_schema:t.schema,columns:t.schema.fields,rows:iX(t)}}let n=await s.prepare(e),r=await n.query(...t);return n.close(),{_results:r,_schema:r.schema,columns:r.schema.fields,rows:iX(r)}}return{worker:n,db:o,conn:s,query:async(e,t=[])=>c(e,t).then(e=>e.rows),queryWithColumns:async(e,t=[])=>c(e,t),close:async()=>{await s.close(),await o.terminate(),await n.terminate()}}}async function sX(e,t){await(await e).conn.send(`BEGIN TRANSACTION`);try{let n=await t(e);return await(await e).conn.send(`COMMIT`),n}catch(t){throw await(await e).conn.send(`ROLLBACK`),t}}async function cX(e,t,n){await(await e).conn.send(`SAVEPOINT ${t}`);try{let r=await n(e);return await(await e).conn.send(`RELEASE SAVEPOINT ${t}`),r}catch(n){throw await(await e).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const Z=Symbol.for(`drizzle:entityKind`),lX=Symbol.for(`drizzle:hasOwnEntityKind`);function Q(e,t){if(!e||typeof e!=`object`)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,Z))throw Error(`Class "${t.name??``}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(Z in n&&n[Z]===t[Z])return!0;n=Object.getPrototypeOf(n)}return!1}var uX=(pr=class{constructor(t,n){e.defineProperty(this,`name`,void 0),e.defineProperty(this,`keyAsName`,void 0),e.defineProperty(this,`primary`,void 0),e.defineProperty(this,`notNull`,void 0),e.defineProperty(this,`default`,void 0),e.defineProperty(this,`defaultFn`,void 0),e.defineProperty(this,`onUpdateFn`,void 0),e.defineProperty(this,`hasDefault`,void 0),e.defineProperty(this,`isUnique`,void 0),e.defineProperty(this,`uniqueName`,void 0),e.defineProperty(this,`uniqueType`,void 0),e.defineProperty(this,`dataType`,void 0),e.defineProperty(this,`columnType`,void 0),e.defineProperty(this,`enumValues`,void 0),e.defineProperty(this,`generated`,void 0),e.defineProperty(this,`generatedIdentity`,void 0),e.defineProperty(this,`config`,void 0),this.table=t,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!==`byDefault`}},e.defineProperty(pr,Z,`Column`),pr),dX=(mr=class{constructor(t,n,r){e.defineProperty(this,`config`,void 0),e.defineProperty(this,`$default`,this.$defaultFn),e.defineProperty(this,`$onUpdate`,this.$onUpdateFn),this.config={name:t,keyAsName:t===``,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===``&&(this.config.name=e)}},e.defineProperty(mr,Z,`ColumnBuilder`),mr);const fX=Symbol.for(`drizzle:Name`);var pX=(hr=class{constructor(t,n){e.defineProperty(this,`reference`,void 0),e.defineProperty(this,`_onUpdate`,`no action`),e.defineProperty(this,`_onDelete`,`no action`),this.reference=()=>{let{name:e,columns:n,foreignColumns:r}=t();return{name:e,columns:n,foreignTable:r[0].table,foreignColumns:r}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(e){return this._onUpdate=e===void 0?`no action`:e,this}onDelete(e){return this._onDelete=e===void 0?`no action`:e,this}build(e){return new mX(e,this)}},e.defineProperty(hr,Z,`PgForeignKeyBuilder`),hr),mX=(gr=class{constructor(t,n){e.defineProperty(this,`reference`,void 0),e.defineProperty(this,`onUpdate`,void 0),e.defineProperty(this,`onDelete`,void 0),this.table=t,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),r=t.map(e=>e.name),i=n.map(e=>e.name),a=[this.table[fX],...r,n[0].table[fX],...i];return e??`${a.join(`_`)}_fk`}},e.defineProperty(gr,Z,`PgForeignKey`),gr);function hX(e,...t){return e(...t)}function gX(e,t){return`${e[fX]}_${t.join(`_`)}_unique`}var _X=(_r=class{constructor(t,n){e.defineProperty(this,`columns`,void 0),e.defineProperty(this,`nullsNotDistinctConfig`,!1),this.name=n,this.columns=t}nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new yX(e,this.columns,this.nullsNotDistinctConfig,this.name)}},e.defineProperty(_r,Z,`PgUniqueConstraintBuilder`),_r),vX=(vr=class{constructor(t){e.defineProperty(this,`name`,void 0),this.name=t}on(...e){return new _X(e,this.name)}},e.defineProperty(vr,Z,`PgUniqueOnConstraintBuilder`),vr),yX=(yr=class{constructor(t,n,r,i){e.defineProperty(this,`columns`,void 0),e.defineProperty(this,`name`,void 0),e.defineProperty(this,`nullsNotDistinct`,!1),this.table=t,this.columns=n,this.name=i??gX(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=r}getName(){return this.name}},e.defineProperty(yr,Z,`PgUniqueConstraint`),yr);function bX(e,t,n){for(let r=t;rArray.isArray(e)?CX(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var wX=(br=class extends dX{constructor(...t){super(...t),e.defineProperty(this,`foreignKeyConfigs`,[])}array(e){return new OX(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:`always`,mode:`stored`},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:r})=>hX((n,r)=>{let i=new pX(()=>{let t=n();return{columns:[e],foreignColumns:[t]}});return r.onUpdate&&i.onUpdate(r.onUpdate),r.onDelete&&i.onDelete(r.onDelete),i.build(t)},n,r))}buildExtraConfigColumn(e){return new EX(e,this.config)}},e.defineProperty(br,Z,`PgColumnBuilder`),br),TX=(xr=class extends uX{constructor(e,t){t.uniqueName||=gX(e,[t.name]),super(e,t),this.table=e}},e.defineProperty(xr,Z,`PgColumn`),xr),EX=(Sr=class extends TX{constructor(...t){super(...t),e.defineProperty(this,`indexConfig`,{order:this.config.order??`asc`,nulls:this.config.nulls??`last`,opClass:this.config.opClass}),e.defineProperty(this,`defaultConfig`,{order:`asc`,nulls:`last`,opClass:void 0})}getSQLType(){return this.getSQLType()}asc(){return this.indexConfig.order=`asc`,this}desc(){return this.indexConfig.order=`desc`,this}nullsFirst(){return this.indexConfig.nulls=`first`,this}nullsLast(){return this.indexConfig.nulls=`last`,this}op(e){return this.indexConfig.opClass=e,this}},e.defineProperty(Sr,Z,`ExtraConfigColumn`),Sr),DX=(Cr=class{constructor(t,n,r,i){e.defineProperty(this,`name`,void 0),e.defineProperty(this,`keyAsName`,void 0),e.defineProperty(this,`type`,void 0),e.defineProperty(this,`indexConfig`,void 0),this.name=t,this.keyAsName=n,this.type=r,this.indexConfig=i}},e.defineProperty(Cr,Z,`IndexedColumn`),Cr),OX=(wr=class extends wX{constructor(e,t,n){super(e,`array`,`PgArray`),this.config.baseBuilder=t,this.config.size=n}build(e){let t=this.config.baseBuilder.build(e);return new kX(e,this.config,t)}},e.defineProperty(wr,Z,`PgArrayBuilder`),wr),kX=(Tr=class t extends TX{constructor(t,n,r,i){super(t,n),e.defineProperty(this,`size`,void 0),this.baseColumn=r,this.range=i,this.size=n.size}getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==`number`?this.size:``}]`}mapFromDriverValue(e){return typeof e==`string`&&(e=SX(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(e,n=!1){let r=e.map(e=>e===null?null:Q(this.baseColumn,t)?this.baseColumn.mapToDriverValue(e,!0):this.baseColumn.mapToDriverValue(e));return n?r:CX(r)}},e.defineProperty(Tr,Z,`PgArray`),Tr),AX=(Er=class extends wX{constructor(e,t){super(e,`string`,`PgEnumObjectColumn`),this.config.enum=t}build(e){return new jX(e,this.config)}},e.defineProperty(Er,Z,`PgEnumObjectColumnBuilder`),Er),jX=(Dr=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`enum`,void 0),e.defineProperty(this,`enumValues`,this.config.enum.enumValues),this.enum=n.enum}getSQLType(){return this.enum.enumName}},e.defineProperty(Dr,Z,`PgEnumObjectColumn`),Dr);const MX=Symbol.for(`drizzle:isPgEnum`);function NX(e){return!!e&&typeof e==`function`&&MX in e&&e[MX]===!0}var PX=(Or=class extends wX{constructor(e,t){super(e,`string`,`PgEnumColumn`),this.config.enum=t}build(e){return new FX(e,this.config)}},e.defineProperty(Or,Z,`PgEnumColumnBuilder`),Or),FX=(kr=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`enum`,this.config.enum),e.defineProperty(this,`enumValues`,this.config.enum.enumValues),this.enum=n.enum}getSQLType(){return this.enum.enumName}},e.defineProperty(kr,Z,`PgEnumColumn`),kr),IX=(Ar=class{constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},e.defineProperty(Ar,Z,`Subquery`),Ar),LX=(jr=class extends IX{},e.defineProperty(jr,Z,`WithSubquery`),jr),RX=`0.44.2`;let zX,BX;const VX={startActiveSpan(e,t){return zX?(BX||=zX.trace.getTracer(`drizzle-orm`,RX),hX((n,r)=>r.startActiveSpan(e,e=>{try{return t(e)}catch(t){throw e.setStatus({code:n.SpanStatusCode.ERROR,message:t instanceof Error?t.message:`Unknown error`}),t}finally{e.end()}}),zX,BX)):t()}},HX=Symbol.for(`drizzle:ViewBaseConfig`),UX=Symbol.for(`drizzle:Schema`),WX=Symbol.for(`drizzle:Columns`),GX=Symbol.for(`drizzle:ExtraConfigColumns`),KX=Symbol.for(`drizzle:OriginalName`),qX=Symbol.for(`drizzle:BaseName`),JX=Symbol.for(`drizzle:IsAlias`),YX=Symbol.for(`drizzle:ExtraConfigBuilder`),XX=Symbol.for(`drizzle:IsDrizzleTable`);var ZX=(Mr=class{constructor(t,n,r){e.defineProperty(this,fX,void 0),e.defineProperty(this,KX,void 0),e.defineProperty(this,UX,void 0),e.defineProperty(this,WX,void 0),e.defineProperty(this,GX,void 0),e.defineProperty(this,qX,void 0),e.defineProperty(this,JX,!1),e.defineProperty(this,XX,!0),e.defineProperty(this,YX,void 0),this[fX]=this[KX]=t,this[UX]=n,this[qX]=r}},e.defineProperty(Mr,Z,`Table`),e.defineProperty(Mr,`Symbol`,{Name:fX,Schema:UX,OriginalName:KX,Columns:WX,ExtraConfigColumns:GX,BaseName:qX,IsAlias:JX,ExtraConfigBuilder:YX}),Mr);function QX(e){return e[fX]}function $X(e){return`${e[UX]??`public`}.${e[fX]}`}var eZ=(Nr=class{},e.defineProperty(Nr,Z,`FakePrimitiveParam`),Nr);function tZ(e){return e!=null&&typeof e.getSQL==`function`}function nZ(e){let t={sql:``,params:[]};for(let r of e){var n;t.sql+=r.sql,t.params.push(...r.params),(n=r.typings)?.length&&(t.typings||=[],t.typings.push(...r.typings))}return t}var rZ=(Pr=class{constructor(t){e.defineProperty(this,`value`,void 0),this.value=Array.isArray(t)?t:[t]}getSQL(){return new iZ([this])}},e.defineProperty(Pr,Z,`StringChunk`),Pr),iZ=(Fr=class t{constructor(t){e.defineProperty(this,`decoder`,sZ),e.defineProperty(this,`shouldInlineParams`,!1),e.defineProperty(this,`usedTables`,[]),this.queryChunks=t;for(let e of t)if(Q(e,ZX)){let t=e[ZX.Symbol.Schema];this.usedTables.push(t===void 0?e[ZX.Symbol.Name]:t+`.`+e[ZX.Symbol.Name])}}append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return VX.startActiveSpan(`drizzle.buildSQL`,t=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(e,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:i,escapeName:a,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:l}=r;return nZ(e.map(e=>{if(Q(e,rZ))return{sql:e.value.join(``),params:[]};if(Q(e,aZ))return{sql:a(e.value),params:[]};if(e===void 0)return{sql:``,params:[]};if(Array.isArray(e)){let t=[new rZ(`(`)];for(let[n,r]of e.entries())t.push(r),ne},cZ={mapToDriverValue:e=>e},lZ={...sZ,...cZ};var uZ=(Lr=class{constructor(t,n=cZ){e.defineProperty(this,`brand`,void 0),this.value=t,this.encoder=n}getSQL(){return new iZ([this])}},e.defineProperty(Lr,Z,`Param`),Lr);function $(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new rZ(e[0]));for(let[r,i]of t.entries())n.push(i,new rZ(e[r+1]));return new iZ(n)}(e=>{function t(){return new iZ([])}e.empty=t;function n(e){return new iZ(e)}e.fromList=n;function r(e){return new iZ([new rZ(e)])}e.raw=r;function i(e,t){let n=[];for(let[r,i]of e.entries())r>0&&t!==void 0&&n.push(t),n.push(i);return new iZ(n)}e.join=i;function a(e){return new aZ(e)}e.identifier=a;function o(e){return new dZ(e)}e.placeholder=o;function s(e,t){return new uZ(e,t)}e.param=s})($||={}),(t=>{class n{constructor(t,n){e.defineProperty(this,`isSelectionField`,!1),this.sql=t,this.fieldAlias=n}getSQL(){return this.sql}clone(){return new n(this.sql,this.fieldAlias)}}e.defineProperty(n,Z,`SQL.Aliased`),t.Aliased=n})(iZ||={});var dZ=(Rr=class{constructor(e){this.name=e}getSQL(){return new iZ([this])}},e.defineProperty(Rr,Z,`Placeholder`),Rr);function fZ(e,t){return e.map(e=>{if(Q(e,dZ)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(Q(e,uZ)&&Q(e.value,dZ)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const pZ=Symbol.for(`drizzle:IsDrizzleView`);var mZ=(zr=class{constructor({name:t,schema:n,selectedFields:r,query:i}){e.defineProperty(this,HX,void 0),e.defineProperty(this,pZ,!0),this[HX]={name:t,originalName:t,schema:n,selectedFields:r,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new iZ([this])}},e.defineProperty(zr,Z,`View`),zr);uX.prototype.getSQL=function(){return new iZ([this])},ZX.prototype.getSQL=function(){return new iZ([this])},IX.prototype.getSQL=function(){return new iZ([this])};var hZ=(Br=class{constructor(e){this.table=e}get(e,t){return t===`table`?this.table:e[t]}},e.defineProperty(Br,Z,`ColumnAliasProxyHandler`),Br),gZ=(Vr=class{constructor(e,t){this.alias=e,this.replaceOriginalName=t}get(e,t){if(t===ZX.Symbol.IsAlias)return!0;if(t===ZX.Symbol.Name||this.replaceOriginalName&&t===ZX.Symbol.OriginalName)return this.alias;if(t===HX)return{...e[HX],name:this.alias,isAlias:!0};if(t===ZX.Symbol.Columns){let t=e[ZX.Symbol.Columns];if(!t)return t;let n={};return Object.keys(t).map(r=>{n[r]=new Proxy(t[r],new hZ(new Proxy(e,this)))}),n}let n=e[t];return Q(n,uX)?new Proxy(n,new hZ(new Proxy(e,this))):n}},e.defineProperty(Vr,Z,`TableAliasProxyHandler`),Vr),_Z=(Hr=class{constructor(e){this.alias=e}get(e,t){return t===`sourceTable`?vZ(e.sourceTable,this.alias):e[t]}},e.defineProperty(Hr,Z,`RelationTableAliasProxyHandler`),Hr);function vZ(e,t){return new Proxy(e,new gZ(t,!1))}function yZ(e,t){return new Proxy(e,new hZ(new Proxy(e.table,new gZ(t,!1))))}function bZ(e,t){return new iZ.Aliased(xZ(e.sql,t),e.fieldAlias)}function xZ(e,t){return $.join(e.queryChunks.map(e=>Q(e,uX)?yZ(e,t):Q(e,iZ)?xZ(e,t):Q(e,iZ.Aliased)?bZ(e,t):e))}var SZ=(Ur=class extends Error{constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},e.defineProperty(Ur,Z,`DrizzleError`),Ur),CZ=(Wr=class extends SZ{constructor(){super({message:`Rollback`})}},e.defineProperty(Wr,Z,`TransactionRollbackError`),Wr),wZ=(Gr=class{write(e){console.log(e)}},e.defineProperty(Gr,Z,`ConsoleLogWriter`),Gr),TZ=(Kr=class{constructor(t){e.defineProperty(this,`writer`,void 0),this.writer=t?.writer??new wZ}logQuery(e,t){let n=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),r=n.length?` -- params: [${n.join(`, `)}]`:``;this.writer.write(`Query: ${e}${r}`)}},e.defineProperty(Kr,Z,`DefaultLogger`),Kr),EZ=(qr=class{logQuery(){}},e.defineProperty(qr,Z,`NoopLogger`),qr),DZ=(ea=Symbol.toStringTag,Jr=class{constructor(){e.defineProperty(this,ea,`QueryPromise`)}catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}},e.defineProperty(Jr,Z,`QueryPromise`),Jr);function OZ(e,t){return Object.entries(e).reduce((e,[n,r])=>{if(typeof n!=`string`)return e;let i=t?[...t,n]:[n];return Q(r,uX)||Q(r,iZ)||Q(r,iZ.Aliased)?e.push({path:i,field:r}):Q(r,ZX)?e.push(...OZ(r[ZX.Symbol.Columns],i)):e.push(...OZ(r,i)),e},[])}function kZ(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let[e,t]of n.entries())if(t!==r[e])return!1;return!0}function AZ(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>Q(n,iZ)||Q(n,uX)?[t,n]:[t,new uZ(n,e[ZX.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function jZ(e,t){for(let n of t)for(let t of Object.getOwnPropertyNames(n.prototype)){if(t===`constructor`)continue;Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(n.prototype,t)||Object.create(null))}}function MZ(e){return e[ZX.Symbol.Columns]}function NZ(e){return Q(e,IX)?e._.alias:Q(e,mZ)?e[HX].name:Q(e,iZ)?void 0:e[ZX.Symbol.IsAlias]?e[ZX.Symbol.Name]:e[ZX.Symbol.BaseName]}function PZ(e){if(typeof e!=`object`||!e||e.constructor.name!==`Object`)return!1;if(`logger`in e){let t=typeof e.logger;return!(t!==`boolean`&&(t!==`object`||typeof e.logger.logQuery!=`function`)&&t!==`undefined`)}if(`schema`in e){let t=typeof e.schema;return!(t!==`object`&&t!==`undefined`)}if(`casing`in e){let t=typeof e.casing;return!(t!==`string`&&t!==`undefined`)}if(`mode`in e)return!(e.mode!==`default`||e.mode!==`planetscale`||e.mode!==void 0);if(`connection`in e){let t=typeof e.connection;return!(t!==`string`&&t!==`object`&&t!==`undefined`)}if(`client`in e){let t=typeof e.client;return!(t!==`object`&&t!==`function`&&t!==`undefined`)}return Object.keys(e).length===0}var FZ=(Yr=class extends wX{defaultNow(){return this.default($`now()`)}},e.defineProperty(Yr,Z,`PgDateColumnBaseBuilder`),Yr),IZ=(Xr=class extends FZ{constructor(e){super(e,`date`,`PgDate`)}build(e){return new LZ(e,this.config)}},e.defineProperty(Xr,Z,`PgDateBuilder`),Xr),LZ=(Zr=class extends TX{getSQLType(){return`date`}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},e.defineProperty(Zr,Z,`PgDate`),Zr),RZ=(Qr=class extends FZ{constructor(e){super(e,`string`,`PgDateString`)}build(e){return new zZ(e,this.config)}},e.defineProperty(Qr,Z,`PgDateStringBuilder`),Qr),zZ=($r=class extends TX{getSQLType(){return`date`}},e.defineProperty($r,Z,`PgDateString`),$r),BZ=(ei=class extends wX{constructor(e){super(e,`json`,`PgJson`)}build(e){return new VZ(e,this.config)}},e.defineProperty(ei,Z,`PgJsonBuilder`),ei),VZ=(ti=class extends TX{constructor(e,t){super(e,t)}getSQLType(){return`json`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},e.defineProperty(ti,Z,`PgJson`),ti),HZ=(ni=class extends wX{constructor(e){super(e,`json`,`PgJsonb`)}build(e){return new UZ(e,this.config)}},e.defineProperty(ni,Z,`PgJsonbBuilder`),ni),UZ=(ri=class extends TX{constructor(e,t){super(e,t)}getSQLType(){return`jsonb`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},e.defineProperty(ri,Z,`PgJsonb`),ri),WZ=(ii=class extends wX{constructor(e,t,n){super(e,`string`,`PgNumeric`),this.config.precision=t,this.config.scale=n}build(e){return new GZ(e,this.config)}},e.defineProperty(ii,Z,`PgNumericBuilder`),ii),GZ=(ai=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`precision`,void 0),e.defineProperty(this,`scale`,void 0),this.precision=n.precision,this.scale=n.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})`}},e.defineProperty(ai,Z,`PgNumeric`),ai),KZ=(oi=class extends wX{constructor(e,t,n){super(e,`number`,`PgNumericNumber`),this.config.precision=t,this.config.scale=n}build(e){return new qZ(e,this.config)}},e.defineProperty(oi,Z,`PgNumericNumberBuilder`),oi),qZ=(si=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`precision`,void 0),e.defineProperty(this,`scale`,void 0),e.defineProperty(this,`mapToDriverValue`,String),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},e.defineProperty(si,Z,`PgNumericNumber`),si),JZ=(ci=class extends wX{constructor(e,t,n){super(e,`bigint`,`PgNumericBigInt`),this.config.precision=t,this.config.scale=n}build(e){return new YZ(e,this.config)}},e.defineProperty(ci,Z,`PgNumericBigIntBuilder`),ci),YZ=(li=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`precision`,void 0),e.defineProperty(this,`scale`,void 0),e.defineProperty(this,`mapFromDriverValue`,BigInt),e.defineProperty(this,`mapToDriverValue`,String),this.precision=n.precision,this.scale=n.scale}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},e.defineProperty(li,Z,`PgNumericBigInt`),li),XZ=(ui=class extends FZ{constructor(e,t,n){super(e,`string`,`PgTime`),this.withTimezone=t,this.precision=n,this.config.withTimezone=t,this.config.precision=n}build(e){return new ZZ(e,this.config)}},e.defineProperty(ui,Z,`PgTimeBuilder`),ui),ZZ=(di=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`withTimezone`,void 0),e.defineProperty(this,`precision`,void 0),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`time${e}${this.withTimezone?` with time zone`:``}`}},e.defineProperty(di,Z,`PgTime`),di),QZ=(fi=class extends FZ{constructor(e,t,n){super(e,`date`,`PgTimestamp`),this.config.withTimezone=t,this.config.precision=n}build(e){return new $Z(e,this.config)}},e.defineProperty(fi,Z,`PgTimestampBuilder`),fi),$Z=(pi=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`withTimezone`,void 0),e.defineProperty(this,`precision`,void 0),e.defineProperty(this,`mapFromDriverValue`,e=>new Date(this.withTimezone?e:e+`+0000`)),e.defineProperty(this,`mapToDriverValue`,e=>e.toISOString()),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){let e=this.precision===void 0?``:` (${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}},e.defineProperty(pi,Z,`PgTimestamp`),pi),eQ=(mi=class extends FZ{constructor(e,t,n){super(e,`string`,`PgTimestampString`),this.config.withTimezone=t,this.config.precision=n}build(e){return new tQ(e,this.config)}},e.defineProperty(mi,Z,`PgTimestampStringBuilder`),mi),tQ=(hi=class extends TX{constructor(t,n){super(t,n),e.defineProperty(this,`withTimezone`,void 0),e.defineProperty(this,`precision`,void 0),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}},e.defineProperty(hi,Z,`PgTimestampString`),hi),nQ=(gi=class extends wX{constructor(e){super(e,`string`,`PgUUID`)}defaultRandom(){return this.default($`gen_random_uuid()`)}build(e){return new rQ(e,this.config)}},e.defineProperty(gi,Z,`PgUUIDBuilder`),gi),rQ=(_i=class extends TX{getSQLType(){return`uuid`}},e.defineProperty(_i,Z,`PgUUID`),_i);const iQ=Symbol.for(`drizzle:PgInlineForeignKeys`),aQ=Symbol.for(`drizzle:EnableRLS`);var oQ=(ta=ZX.Symbol.ExtraConfigBuilder,na=ZX.Symbol.ExtraConfigColumns,vi=class extends ZX{constructor(...t){super(...t),e.defineProperty(this,iQ,[]),e.defineProperty(this,aQ,!1),e.defineProperty(this,ta,void 0),e.defineProperty(this,na,{})}},e.defineProperty(vi,Z,`PgTable`),e.defineProperty(vi,`Symbol`,Object.assign({},ZX.Symbol,{InlineForeignKeys:iQ,EnableRLS:aQ})),vi),sQ=(yi=class{constructor(t,n){e.defineProperty(this,`columns`,void 0),e.defineProperty(this,`name`,void 0),this.columns=t,this.name=n}build(e){return new cQ(e,this.columns,this.name)}},e.defineProperty(yi,Z,`PgPrimaryKeyBuilder`),yi),cQ=(bi=class{constructor(t,n,r){e.defineProperty(this,`columns`,void 0),e.defineProperty(this,`name`,void 0),this.table=t,this.columns=n,this.name=r}getName(){return this.name??`${this.table[oQ.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}},e.defineProperty(bi,Z,`PgPrimaryKey`),bi);function lQ(e,t){return oZ(t)&&!tZ(e)&&!Q(e,uZ)&&!Q(e,dZ)&&!Q(e,uX)&&!Q(e,ZX)&&!Q(e,mZ)?new uZ(e,t):e}const uQ=(e,t)=>$`${e} = ${lQ(t,e)}`,dQ=(e,t)=>$`${e} <> ${lQ(t,e)}`;function fQ(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new iZ(t):new iZ([new rZ(`(`),$.join(t,new rZ(` and `)),new rZ(`)`)])}function pQ(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new iZ(t):new iZ([new rZ(`(`),$.join(t,new rZ(` or `)),new rZ(`)`)])}function mQ(e){return $`not ${e}`}const hQ=(e,t)=>$`${e} > ${lQ(t,e)}`,gQ=(e,t)=>$`${e} >= ${lQ(t,e)}`,_Q=(e,t)=>$`${e} < ${lQ(t,e)}`,vQ=(e,t)=>$`${e} <= ${lQ(t,e)}`;function yQ(e,t){return Array.isArray(t)?t.length===0?$`false`:$`${e} in ${t.map(t=>lQ(t,e))}`:$`${e} in ${lQ(t,e)}`}function bQ(e,t){return Array.isArray(t)?t.length===0?$`true`:$`${e} not in ${t.map(t=>lQ(t,e))}`:$`${e} not in ${lQ(t,e)}`}function xQ(e){return $`${e} is null`}function SQ(e){return $`${e} is not null`}function CQ(e){return $`exists ${e}`}function wQ(e){return $`not exists ${e}`}function TQ(e,t,n){return $`${e} between ${lQ(t,e)} and ${lQ(n,e)}`}function EQ(e,t,n){return $`${e} not between ${lQ(t,e)} and ${lQ(n,e)}`}function DQ(e,t){return $`${e} like ${t}`}function OQ(e,t){return $`${e} not like ${t}`}function kQ(e,t){return $`${e} ilike ${t}`}function AQ(e,t){return $`${e} not ilike ${t}`}function jQ(e){return $`${e} asc`}function MQ(e){return $`${e} desc`}var NQ=(xi=class{constructor(t,n,r){e.defineProperty(this,`referencedTableName`,void 0),e.defineProperty(this,`fieldName`,void 0),this.sourceTable=t,this.referencedTable=n,this.relationName=r,this.referencedTableName=n[ZX.Symbol.Name]}},e.defineProperty(xi,Z,`Relation`),xi),PQ=(Si=class{constructor(e,t){this.table=e,this.config=t}},e.defineProperty(Si,Z,`Relations`),Si),FQ=(Ci=class e extends NQ{constructor(e,t,n,r){super(e,t,n?.relationName),this.config=n,this.isNullable=r}withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config,this.isNullable);return n.fieldName=t,n}},e.defineProperty(Ci,Z,`One`),Ci),IQ=(wi=class e extends NQ{constructor(e,t,n){super(e,t,n?.relationName),this.config=n}withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config);return n.fieldName=t,n}},e.defineProperty(wi,Z,`Many`),wi);function LQ(){return{and:fQ,between:TQ,eq:uQ,exists:CQ,gt:hQ,gte:gQ,ilike:kQ,inArray:yQ,isNull:xQ,isNotNull:SQ,like:DQ,lt:_Q,lte:vQ,ne:dQ,not:mQ,notBetween:EQ,notExists:wQ,notLike:OQ,notIlike:AQ,notInArray:bQ,or:pQ,sql:$}}function RQ(){return{sql:$,asc:jQ,desc:MQ}}function zQ(e,t){Object.keys(e).length===1&&`default`in e&&!Q(e.default,ZX)&&(e=e.default);let n={},r={},i={};for(let[o,s]of Object.entries(e))if(Q(s,ZX)){var a;let e=$X(s),t=r[e];n[e]=o,i[o]={tsName:o,dbName:s[ZX.Symbol.Name],schema:s[ZX.Symbol.Schema],columns:s[ZX.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]};for(let e of Object.values(s[ZX.Symbol.Columns]))e.primary&&i[o].primaryKey.push(e);let c=(a=s[ZX.Symbol.ExtraConfigBuilder])?.call(s,s[ZX.Symbol.ExtraConfigColumns]);if(c)for(let e of Object.values(c))Q(e,sQ)&&i[o].primaryKey.push(...e.columns)}else if(Q(s,PQ)){let e=$X(s.table),a=n[e],o=s.config(t(s.table)),c;for(let[t,n]of Object.entries(o))if(a){let e=i[a];e.relations[t]=n,c&&e.primaryKey.push(...c)}else e in r||(r[e]={relations:{},primaryKey:c}),r[e].relations[t]=n}return{tables:i,tableNamesMap:n}}function BQ(e){return function(t,n){return new FQ(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function VQ(e){return function(t,n){return new IQ(e,t,n)}}function HQ(e,t,n){if(Q(n,FQ)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[$X(n.referencedTable)];if(!r)throw Error(`Table "${n.referencedTable[ZX.Symbol.Name]}" not found in schema`);let i=e[r];if(!i)throw Error(`Table "${r}" not found in schema`);let a=n.sourceTable,o=t[$X(a)];if(!o)throw Error(`Table "${a[ZX.Symbol.Name]}" not found in schema`);let s=[];for(let e of Object.values(i.relations))(n.relationName&&n!==e&&e.relationName===n.relationName||!n.relationName&&e.referencedTable===n.sourceTable)&&s.push(e);if(s.length>1)throw n.relationName?Error(`There are multiple relations with name "${n.relationName}" in table "${r}"`):Error(`There are multiple relations between "${r}" and "${n.sourceTable[ZX.Symbol.Name]}". Please specify relation name`);if(s[0]&&Q(s[0],FQ)&&s[0].config)return{fields:s[0].config.references,references:s[0].config.fields};throw Error(`There is not enough information to infer relation "${o}.${n.fieldName}"`)}function UQ(e){return{one:BQ(e),many:VQ(e)}}function WQ(e,t,n,r,i=e=>e){let a={};for(let[o,s]of r.entries())if(s.isJson){let r=t.relations[s.tsKey],c=n[o],l=typeof c==`string`?JSON.parse(c):c;a[s.tsKey]=Q(r,FQ)?l&&WQ(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>WQ(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=Q(t,uX)?t:Q(t,iZ)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}var GQ=(Ti=class t{constructor(t){e.defineProperty(this,`config`,void 0),this.config={...t}}get(e,n){if(n===`_`)return{...e._,selectedFields:new Proxy(e._.selectedFields,this)};if(n===HX)return{...e[HX],selectedFields:new Proxy(e[HX].selectedFields,this)};if(typeof n==`symbol`)return e[n];let r=Q(e,IX)?e._.selectedFields:Q(e,mZ)?e[HX].selectedFields:e,i=r[n];if(Q(i,iZ.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!i.isSelectionField)return i.sql;let e=i.clone();return e.isSelectionField=!0,e}if(Q(i,iZ)){if(this.config.sqlBehavior===`sql`)return i;throw Error(`You tried to reference "${n}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return Q(i,uX)?this.config.alias?new Proxy(i,new hZ(new Proxy(i.table,new gZ(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!=`object`||!i?i:new Proxy(i,new t(this.config))}},e.defineProperty(Ti,Z,`SelectionProxyHandler`),Ti);function KQ(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.map(e=>e.toLowerCase()).join(`_`)}function qQ(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.reduce((e,t,n)=>{let r=n===0?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`;return e+r},``)}function JQ(e){return e}var YQ=(Ei=class{constructor(t){e.defineProperty(this,`cache`,{}),e.defineProperty(this,`cachedTables`,{}),e.defineProperty(this,`convert`,void 0),this.convert=t===`snake_case`?KQ:t===`camelCase`?qQ:JQ}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=e.table[ZX.Symbol.Schema]??`public`,n=e.table[ZX.Symbol.OriginalName],r=`${t}.${n}.${e.name}`;return this.cache[r]||this.cacheTable(e.table),this.cache[r]}cacheTable(e){let t=e[ZX.Symbol.Schema]??`public`,n=e[ZX.Symbol.OriginalName],r=`${t}.${n}`;if(!this.cachedTables[r]){for(let t of Object.values(e[ZX.Symbol.Columns])){let e=`${r}.${t.name}`;this.cache[e]=this.convert(t.name)}this.cachedTables[r]=!0}}clearCache(){this.cache={},this.cachedTables={}}},e.defineProperty(Ei,Z,`CasingCache`),Ei),XQ=(Di=class extends mZ{},e.defineProperty(Di,Z,`PgViewBase`),Di),ZQ=(Oi=class{constructor(t){e.defineProperty(this,`casing`,void 0),this.casing=new YQ(t?.casing)}async migrate(e,t,n){let r=typeof n==`string`?`__drizzle_migrations`:n.migrationsTable??`__drizzle_migrations`,i=typeof n==`string`?`drizzle`:n.migrationsSchema??`drizzle`,a=$` CREATE TABLE IF NOT EXISTS ${$.identifier(i)}.${$.identifier(r)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint ) `;await t.execute($`CREATE SCHEMA IF NOT EXISTS ${$.identifier(i)}`),await t.execute(a);let o=await t.all($`select id, hash, created_at from ${$.identifier(i)}.${$.identifier(r)} order by created_at desc limit 1`),s=o[0];await t.transaction(async t=>{for await(let n of e)if(!s||Number(s.created_at){var r;return t[e]!==void 0||(r=n[e])?.onUpdateFn!==void 0}),i=r.length;return $.join(r.flatMap((e,r)=>{let a=n[e],o=t[e]??$.param(a.onUpdateFn(),a),s=$`${$.identifier(this.casing.getColumnCasing(a))} = ${o}`;return r{let i=[];if(Q(e,iZ.Aliased)&&e.isSelectionField)i.push($.identifier(e.fieldAlias));else if(Q(e,iZ.Aliased)||Q(e,iZ)){let n=Q(e,iZ.Aliased)?e.sql:e;t?i.push(new iZ(n.queryChunks.map(e=>Q(e,TX)?$.identifier(this.casing.getColumnCasing(e)):e))):i.push(n),Q(e,iZ.Aliased)&&i.push($` as ${$.identifier(e.fieldAlias)}`)}else Q(e,uX)&&(t?i.push($.identifier(this.casing.getColumnCasing(e))):i.push(e));return ro?.some(({alias:t})=>t===(e[ZX.Symbol.IsAlias]?QX(e):e[ZX.Symbol.BaseName])))(e.field.table)){let t=QX(e.field.table);throw Error(`Your "${e.path.join(`->`)}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}let h=!o||o.length===0,g=this.buildWithCTE(e),_;f&&(_=f===!0?$` distinct`:$` distinct on (${$.join(f.on,$`, `)})`);let v=this.buildSelection(m,{isSingleTable:h}),y=this.buildFromTable(a),b=this.buildJoins(o),x=r?$` where ${r}`:void 0,S=i?$` having ${i}`:void 0,C;s&&s.length>0&&(C=$` order by ${$.join(s,$`, `)}`);let w;c&&c.length>0&&(w=$` group by ${$.join(c,$`, `)}`);let T=typeof l==`object`||typeof l==`number`&&l>=0?$` limit ${l}`:void 0,E=u?$` offset ${u}`:void 0,D=$.empty();if(d){let e=$` for ${$.raw(d.strength)}`;d.config.of&&e.append($` of ${$.join(Array.isArray(d.config.of)?d.config.of:[d.config.of],$`, `)}`),d.config.noWait?e.append($` nowait`):d.config.skipLocked&&e.append($` skip locked`),D.append(e)}let O=$`${g}select${_} ${v} from ${y}${b}${x}${w}${S}${C}${T}${E}${D}`;return p.length>0?this.buildSetOperations(O,p):O}buildSetOperations(e,t){let[n,...r]=t;if(!n)throw Error(`Cannot pass undefined values to any set operator`);return r.length===0?this.buildSetOperationQuery({leftSelect:e,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:n}),r)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:n,rightSelect:r,limit:i,orderBy:a,offset:o}}){let s=$`(${e.getSQL()}) `,c=$`(${r.getSQL()})`,l;if(a&&a.length>0){let e=[];for(let t of a)if(Q(t,TX))e.push($.identifier(t.name));else if(Q(t,iZ)){for(let e=0;e=0?$` limit ${i}`:void 0,d=$.raw(`${t} ${n?`all `:``}`),f=o?$` offset ${o}`:void 0;return $`${s}${d}${c}${l}${u}${f}`}buildInsertQuery({table:e,values:t,onConflict:n,returning:r,withList:i,select:a,overridingSystemValue_:o}){let s=[],c=e[ZX.Symbol.Columns],l=Object.entries(c).filter(([e,t])=>!t.shouldDisableInsert()),u=l.map(([,e])=>$.identifier(this.casing.getColumnCasing(e)));if(a){let e=t;Q(e,iZ)?s.push(e):s.push(e.getSQL())}else{let e=t;s.push($.raw(`values `));for(let[t,n]of e.entries()){let r=[];for(let[e,t]of l){let i=n[e];if(i===void 0||Q(i,uZ)&&i.value===void 0)if(t.defaultFn!==void 0){let e=t.defaultFn(),n=Q(e,iZ)?e:$.param(e,t);r.push(n)}else if(!t.default&&t.onUpdateFn!==void 0){let e=t.onUpdateFn(),n=Q(e,iZ)?e:$.param(e,t);r.push(n)}else r.push($`default`);else r.push(i)}s.push(r),t({dbKey:t.name,tsKey:e,field:yZ(t,o),relationTableTsKey:void 0,isJson:!1,selection:[]}))}else{let r=Object.fromEntries(Object.entries(i.columns).map(([e,t])=>[e,yZ(t,o)]));if(a.where){let e=typeof a.where==`function`?a.where(r,LQ()):a.where;p=e&&xZ(e,o)}let s=[],c=[];if(a.columns){let e=!1;for(let[t,n]of Object.entries(a.columns)){if(n===void 0)continue;t in i.columns&&(!e&&n===!0&&(e=!0),c.push(t))}c.length>0&&(c=e?c.filter(e=>{var t;return(t=a.columns)?.[e]===!0}):Object.keys(i.columns).filter(e=>!c.includes(e)))}else c=Object.keys(i.columns);for(let e of c){let t=i.columns[e];s.push({tsKey:e,value:t})}let h=[];a.with&&(h=Object.entries(a.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:i.relations[e]})));let g;if(a.extras){g=typeof a.extras==`function`?a.extras(r,{sql:$}):a.extras;for(let[e,t]of Object.entries(g))s.push({tsKey:e,value:bZ(t,o)})}for(let{tsKey:e,value:t}of s)l.push({dbKey:Q(t,iZ.Aliased)?t.fieldAlias:i.columns[e].name,tsKey:e,field:Q(t,uX)?yZ(t,o):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let _=typeof a.orderBy==`function`?a.orderBy(r,RQ()):a.orderBy??[];Array.isArray(_)||(_=[_]),f=_.map(e=>Q(e,uX)?yZ(e,o):xZ(e,o)),u=a.limit,d=a.offset;for(let{tsKey:r,queryConfig:i,relation:a}of h){let s=HQ(t,n,a),c=$X(a.referencedTable),u=n[c],d=`${o}_${r}`,f=fQ(...s.fields.map((e,t)=>uQ(yZ(s.references[t],d),yZ(e,o)))),p=this.buildRelationalQueryWithoutPK({fullSchema:e,schema:t,tableNamesMap:n,table:e[u],tableConfig:t[u],queryConfig:Q(a,FQ)?i===!0?{limit:1}:{...i,limit:1}:i,tableAlias:d,joinOn:f,nestedQueryRelation:a}),h=$`${$.identifier(d)}.${$.identifier(`data`)}`.as(r);m.push({on:$`true`,table:new IX(p.sql,{},d),alias:d,joinType:`left`,lateral:!0}),l.push({dbKey:r,tsKey:r,field:h,relationTableTsKey:u,isJson:!0,selection:p.selection})}}if(l.length===0)throw new SZ({message:`No fields selected for table "${i.tsName}" ("${o}")`});let h;if(p=fQ(c,p),s){let e=$`json_build_array(${$.join(l.map(({field:e,tsKey:t,isJson:n})=>n?$`${$.identifier(`${o}_${t}`)}.${$.identifier(`data`)}`:Q(e,iZ.Aliased)?e.sql:e),$`, `)})`;Q(s,IQ)&&(e=$`coalesce(json_agg(${e}${f.length>0?$` order by ${$.join(f,$`, `)}`:void 0}), '[]'::json)`);let t=[{dbKey:`data`,tsKey:`data`,field:e.as(`data`),isJson:!0,relationTableTsKey:i.tsName,selection:l}],n=u!==void 0||d!==void 0||f.length>0;n?(h=this.buildSelectQuery({table:vZ(r,o),fields:{},fieldsFlat:[{path:[],field:$.raw(`*`)}],where:p,limit:u,offset:d,orderBy:f,setOperators:[]}),p=void 0,u=void 0,d=void 0,f=[]):h=vZ(r,o),h=this.buildSelectQuery({table:Q(h,oQ)?h:new IX(h,{},o),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:Q(e,uX)?yZ(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]})}else h=this.buildSelectQuery({table:vZ(r,o),fields:{},fieldsFlat:l.map(({field:e})=>({path:[],field:Q(e,uX)?yZ(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]});return{tableTsKey:i.tsName,sql:h,selection:l}}},e.defineProperty(Oi,Z,`PgDialect`),Oi),QQ=(ki=class{getSelectedFields(){return this._.selectedFields}},e.defineProperty(ki,Z,`TypedQueryBuilder`),ki),$Q=(Ai=class{constructor(t){e.defineProperty(this,`fields`,void 0),e.defineProperty(this,`session`,void 0),e.defineProperty(this,`dialect`,void 0),e.defineProperty(this,`withList`,[]),e.defineProperty(this,`distinct`,void 0),e.defineProperty(this,`authToken`,void 0),this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(e){return this.authToken=e,this}from(e){let t=!!this.fields,n=e,r;return r=this.fields?this.fields:Q(n,IX)?Object.fromEntries(Object.keys(n._.selectedFields).map(e=>[e,n[e]])):Q(n,XQ)?n[HX].selectedFields:Q(n,iZ)?{}:MZ(n),new t$({table:n,fields:r,isPartialSelect:t,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}},e.defineProperty(Ai,Z,`PgSelectBuilder`),Ai),e$=(ji=class extends QQ{constructor({table:t,fields:n,isPartialSelect:r,session:i,dialect:a,withList:o,distinct:s}){super(),e.defineProperty(this,`_`,void 0),e.defineProperty(this,`config`,void 0),e.defineProperty(this,`joinsNotNullableMap`,void 0),e.defineProperty(this,`tableName`,void 0),e.defineProperty(this,`isPartialSelect`,void 0),e.defineProperty(this,`session`,void 0),e.defineProperty(this,`dialect`,void 0),e.defineProperty(this,`cacheConfig`,void 0),e.defineProperty(this,`usedTables`,new Set),e.defineProperty(this,`leftJoin`,this.createJoin(`left`,!1)),e.defineProperty(this,`leftJoinLateral`,this.createJoin(`left`,!0)),e.defineProperty(this,`rightJoin`,this.createJoin(`right`,!1)),e.defineProperty(this,`innerJoin`,this.createJoin(`inner`,!1)),e.defineProperty(this,`innerJoinLateral`,this.createJoin(`inner`,!0)),e.defineProperty(this,`fullJoin`,this.createJoin(`full`,!1)),e.defineProperty(this,`crossJoin`,this.createJoin(`cross`,!1)),e.defineProperty(this,`crossJoinLateral`,this.createJoin(`cross`,!0)),e.defineProperty(this,`union`,this.createSetOperator(`union`,!1)),e.defineProperty(this,`unionAll`,this.createSetOperator(`union`,!0)),e.defineProperty(this,`intersect`,this.createSetOperator(`intersect`,!1)),e.defineProperty(this,`intersectAll`,this.createSetOperator(`intersect`,!0)),e.defineProperty(this,`except`,this.createSetOperator(`except`,!1)),e.defineProperty(this,`exceptAll`,this.createSetOperator(`except`,!0)),this.config={withList:o,table:t,fields:{...n},distinct:s,setOperators:[]},this.isPartialSelect=r,this.session=i,this.dialect=a,this._={selectedFields:n,config:this.config},this.tableName=NZ(t),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{};for(let e of d$(t))this.usedTables.add(e)}getUsedTables(){return[...this.usedTables]}createJoin(e,t){return(n,r)=>{var i;let a=this.tableName,o=NZ(n);for(let e of d$(n))this.usedTables.add(e);if(typeof o==`string`&&(i=this.config.joins)?.some(e=>e.alias===o))throw Error(`Alias "${o}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof a==`string`&&(this.config.fields={[a]:this.config.fields}),typeof o==`string`&&!Q(n,iZ))){let e=Q(n,IX)?n._.selectedFields:Q(n,mZ)?n[HX].selectedFields:n[ZX.Symbol.Columns];this.config.fields[o]=e}if(typeof r==`function`&&(r=r(new Proxy(this.config.fields,new GQ({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:r,table:n,joinType:e,alias:o,lateral:t}),typeof o==`string`)switch(e){case`left`:this.joinsNotNullableMap[o]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[o]=!0;break;case`cross`:case`inner`:this.joinsNotNullableMap[o]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[o]=!1;break}return this}}createSetOperator(e,t){return n=>{let r=typeof n==`function`?n(r$()):n;if(!kZ(this.getSelectedFields(),r.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return this.config.setOperators.push({type:e,isAll:t,rightSelect:r}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new GQ({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.where=e,this}having(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new GQ({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new GQ({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new GQ({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`}))),n=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{let t=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=t:this.config.orderBy=t}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,t={}){return this.config.lockingClause={strength:e,config:t},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){let t=[];if(t.push(...d$(this.config.table)),this.config.joins)for(let e of this.config.joins)t.push(...d$(e.table));return new Proxy(new IX(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new GQ({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}getSelectedFields(){return new Proxy(this.config.fields,new GQ({alias:this.tableName,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}$dynamic(){return this}$withCache(e){return this.cacheConfig=e===void 0?{config:{},enable:!0,autoInvalidate:!0}:e===!1?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}},e.defineProperty(ji,Z,`PgSelectQueryBuilder`),ji),t$=(Mi=class extends e${constructor(...t){super(...t),e.defineProperty(this,`authToken`,void 0),e.defineProperty(this,`execute`,e=>VX.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken)))}_prepare(e){let{session:t,config:n,dialect:r,joinsNotNullableMap:i,authToken:a,cacheConfig:o,usedTables:s}=this;if(!t)throw Error(`Cannot execute a query on a query builder. Please use a database instance instead.`);let{fields:c}=n;return VX.startActiveSpan(`drizzle.prepareQuery`,()=>{let n=OZ(c),l=t.prepareQuery(r.sqlToQuery(this.getSQL()),n,e,!0,void 0,{type:`select`,tables:[...s]},o);return l.joinsNotNullableMap=i,l.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}},e.defineProperty(Mi,Z,`PgSelect`),Mi);jZ(t$,[DZ]);function n$(e,t){return(n,r,...i)=>{let a=[r,...i].map(n=>({type:e,isAll:t,rightSelect:n}));for(let e of a)if(!kZ(n.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return n.addSetOperators(a)}}const r$=()=>({union:i$,unionAll:a$,intersect:o$,intersectAll:s$,except:c$,exceptAll:l$}),i$=n$(`union`,!1),a$=n$(`union`,!0),o$=n$(`intersect`,!1),s$=n$(`intersect`,!0),c$=n$(`except`,!1),l$=n$(`except`,!0);var u$=(Ni=class{constructor(t){e.defineProperty(this,`dialect`,void 0),e.defineProperty(this,`dialectConfig`,void 0),e.defineProperty(this,`$with`,(e,t)=>{let n=this,r=r=>(typeof r==`function`&&(r=r(n)),new Proxy(new LX(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new GQ({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}}),this.dialect=Q(t,ZQ)?t:void 0,this.dialectConfig=Q(t,ZQ)?void 0:t}with(...e){let t=this;function n(n){return new $Q({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e})}function r(e){return new $Q({fields:e??void 0,session:void 0,dialect:t.getDialect(),distinct:!0})}function i(e,n){return new $Q({fields:n??void 0,session:void 0,dialect:t.getDialect(),distinct:{on:e}})}return{select:n,selectDistinct:r,selectDistinctOn:i}}select(e){return new $Q({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new $Q({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(e,t){return new $Q({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:e}})}getDialect(){return this.dialect||=new ZQ(this.dialectConfig),this.dialect}},e.defineProperty(Ni,Z,`PgQueryBuilder`),Ni);function d$(e){return Q(e,oQ)?[e[UX]?`${e[UX]}.${e[ZX.Symbol.BaseName]}`:e[ZX.Symbol.BaseName]]:Q(e,IX)?e._.usedTables??[]:Q(e,iZ)?e.usedTables??[]:[]}var f$=(Pi=class extends DZ{constructor(t,n,r,i){super(),e.defineProperty(this,`config`,void 0),e.defineProperty(this,`cacheConfig`,void 0),e.defineProperty(this,`authToken`,void 0),e.defineProperty(this,`execute`,e=>VX.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))),this.session=n,this.dialect=r,this.config={table:t,withList:i}}where(e){return this.config.where=e,this}returning(e=this.config.table[ZX.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=OZ(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return VX.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`delete`,tables:d$(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new GQ({alias:QX(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},e.defineProperty(Pi,Z,`PgDelete`),Pi),p$=(Fi=class{constructor(t,n,r,i,a){e.defineProperty(this,`authToken`,void 0),this.table=t,this.session=n,this.dialect=r,this.withList=i,this.overridingSystemValue_=a}setToken(e){return this.authToken=e,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(e){if(e=Array.isArray(e)?e:[e],e.length===0)throw Error(`values() must be called with at least one value`);let t=e.map(e=>{let t={},n=this.table[ZX.Symbol.Columns];for(let r of Object.keys(e)){let i=e[r];t[r]=Q(i,iZ)?i:new uZ(i,n[r])}return t});return new m$(this.table,t,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(e){let t=typeof e==`function`?e(new u$):e;if(!Q(t,iZ)&&!kZ(this.table[WX],t._.selectedFields))throw Error(`Insert select error: selected fields are not the same or are in a different order compared to the table definition`);return new m$(this.table,t,this.session,this.dialect,this.withList,!0)}},e.defineProperty(Fi,Z,`PgInsertBuilder`),Fi),m$=(Ii=class extends DZ{constructor(t,n,r,i,a,o,s){super(),e.defineProperty(this,`config`,void 0),e.defineProperty(this,`cacheConfig`,void 0),e.defineProperty(this,`authToken`,void 0),e.defineProperty(this,`execute`,e=>VX.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))),this.session=r,this.dialect=i,this.config={table:t,values:n,withList:a,select:o,overridingSystemValue_:s}}returning(e=this.config.table[ZX.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=OZ(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=$`do nothing`;else{let t=``;t=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));let n=e.where?$` where ${e.where}`:void 0;this.config.onConflict=$`(${$.raw(t)})${n} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw Error(`You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.`);let t=e.where?$` where ${e.where}`:void 0,n=e.targetWhere?$` where ${e.targetWhere}`:void 0,r=e.setWhere?$` where ${e.setWhere}`:void 0,i=this.dialect.buildUpdateSet(this.config.table,AZ(this.config.table,e.set)),a=``;return a=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=$`(${$.raw(a)})${n} do update set ${i}${t}${r}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return VX.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:d$(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new GQ({alias:QX(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},e.defineProperty(Ii,Z,`PgInsert`),Ii),h$=(Li=class extends DZ{constructor(t,n,r){super(),e.defineProperty(this,`config`,void 0),e.defineProperty(this,`authToken`,void 0),e.defineProperty(this,`execute`,e=>VX.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))),this.session=n,this.dialect=r,this.config={view:t}}concurrently(){if(this.config.withNoData!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return VX.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}},e.defineProperty(Li,Z,`PgRefreshMaterializedView`),Li),g$=(Ri=class{constructor(t,n,r,i){e.defineProperty(this,`authToken`,void 0),this.table=t,this.session=n,this.dialect=r,this.withList=i}setToken(e){return this.authToken=e,this}set(e){return new _$(this.table,AZ(this.table,e),this.session,this.dialect,this.withList).setToken(this.authToken)}},e.defineProperty(Ri,Z,`PgUpdateBuilder`),Ri),_$=(zi=class extends DZ{constructor(t,n,r,i,a){super(),e.defineProperty(this,`config`,void 0),e.defineProperty(this,`tableName`,void 0),e.defineProperty(this,`joinsNotNullableMap`,void 0),e.defineProperty(this,`cacheConfig`,void 0),e.defineProperty(this,`leftJoin`,this.createJoin(`left`)),e.defineProperty(this,`rightJoin`,this.createJoin(`right`)),e.defineProperty(this,`innerJoin`,this.createJoin(`inner`)),e.defineProperty(this,`fullJoin`,this.createJoin(`full`)),e.defineProperty(this,`authToken`,void 0),e.defineProperty(this,`execute`,e=>this._prepare().execute(e,this.authToken)),this.session=r,this.dialect=i,this.config={set:n,table:t,withList:a,joins:[]},this.tableName=NZ(t),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{}}from(e){let t=e,n=NZ(t);return typeof n==`string`&&(this.joinsNotNullableMap[n]=!0),this.config.from=t,this}getTableLikeFields(e){return Q(e,oQ)?e[ZX.Symbol.Columns]:Q(e,IX)?e._.selectedFields:e[HX].selectedFields}createJoin(e){return(t,n)=>{let r=NZ(t);if(typeof r==`string`&&this.config.joins.some(e=>e.alias===r))throw Error(`Alias "${r}" is already used in this query`);if(typeof n==`function`){let e=this.config.from&&!Q(this.config.from,iZ)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[ZX.Symbol.Columns],new GQ({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})),e&&new Proxy(e,new GQ({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))}if(this.config.joins.push({on:n,table:t,joinType:e,alias:r}),typeof r==`string`)switch(e){case`left`:this.joinsNotNullableMap[r]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!0;break;case`inner`:this.joinsNotNullableMap[r]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!1;break}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[ZX.Symbol.Columns]),this.config.from)){let t=NZ(this.config.from);if(typeof t==`string`&&this.config.from&&!Q(this.config.from,iZ)){let n=this.getTableLikeFields(this.config.from);e[t]=n}for(let t of this.config.joins){let n=NZ(t.table);if(typeof n==`string`&&!Q(t.table,iZ)){let r=this.getTableLikeFields(t.table);e[n]=r}}}return this.config.returningFields=e,this.config.returning=OZ(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){let t=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:d$(this.config.table)},this.cacheConfig);return t.joinsNotNullableMap=this.joinsNotNullableMap,t}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new GQ({alias:QX(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},e.defineProperty(zi,Z,`PgUpdate`),zi),v$=(ra=Symbol.toStringTag,Bi=class t extends iZ{constructor(n){super(t.buildEmbeddedCount(n.source,n.filters).queryChunks),e.defineProperty(this,`sql`,void 0),e.defineProperty(this,`token`,void 0),e.defineProperty(this,ra,`PgCountBuilder`),e.defineProperty(this,`session`,void 0),this.params=n,this.mapWith(Number),this.session=n.session,this.sql=t.buildCount(n.source,n.filters)}static buildEmbeddedCount(e,t){return $`(select count(*) from ${e}${$.raw(` where `).if(t)}${t})`}static buildCount(e,t){return $`select count(*) as count from ${e}${$.raw(` where `).if(t)}${t};`}setToken(e){return this.token=e,this}then(e,t){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}},e.defineProperty(Bi,Z,`PgCountBuilder`),Bi),y$=(Vi=class{constructor(e,t,n,r,i,a,o){this.fullSchema=e,this.schema=t,this.tableNamesMap=n,this.table=r,this.tableConfig=i,this.dialect=a,this.session=o}findMany(e){return new b$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},`many`)}findFirst(e){return new b$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},`first`)}},e.defineProperty(Vi,Z,`PgRelationalQueryBuilder`),Vi),b$=(Hi=class extends DZ{constructor(t,n,r,i,a,o,s,c,l){super(),e.defineProperty(this,`authToken`,void 0),this.fullSchema=t,this.schema=n,this.tableNamesMap=r,this.table=i,this.tableConfig=a,this.dialect=o,this.session=s,this.config=c,this.mode=l}_prepare(e){return VX.startActiveSpan(`drizzle.prepareQuery`,()=>{let{query:t,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(e,n)=>{let r=e.map(e=>WQ(this.schema,this.tableConfig,e,t.selection,n));return this.mode===`first`?r[0]:r})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let e=this._getQuery(),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return VX.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(void 0,this.authToken))}},e.defineProperty(Hi,Z,`PgRelationalQuery`),Hi),x$=(Ui=class extends DZ{constructor(e,t,n,r){super(),this.execute=e,this.sql=t,this.query=n,this.mapBatchResult=r}getSQL(){return this.sql}getQuery(){return this.query}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}},e.defineProperty(Ui,Z,`PgRaw`),Ui),S$=(Wi=class{constructor(t,n,r){if(e.defineProperty(this,`query`,void 0),e.defineProperty(this,`$with`,(e,t)=>{let n=this,r=r=>(typeof r==`function`&&(r=r(new u$(n.dialect))),new Proxy(new LX(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new GQ({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}}),e.defineProperty(this,`$cache`,void 0),e.defineProperty(this,`authToken`,void 0),this.dialect=t,this.session=n,this._=r?{schema:r.schema,fullSchema:r.fullSchema,tableNamesMap:r.tableNamesMap,session:n}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:n},this.query={},this._.schema)for(let[e,i]of Object.entries(this._.schema))this.query[e]=new y$(r.fullSchema,this._.schema,this._.tableNamesMap,r.fullSchema[e],i,t,n);this.$cache={invalidate:async e=>{}}}$count(e,t){return new v$({source:e,filters:t,session:this.session})}with(...e){let t=this;function n(n){return new $Q({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e})}function r(n){return new $Q({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})}function i(n,r){return new $Q({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:{on:n}})}function a(n){return new g$(n,t.session,t.dialect,e)}function o(n){return new p$(n,t.session,t.dialect,e)}function s(n){return new f$(n,t.session,t.dialect,e)}return{select:n,selectDistinct:r,selectDistinctOn:i,update:a,insert:o,delete:s}}select(e){return new $Q({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new $Q({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(e,t){return new $Q({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:{on:e}})}update(e){return new g$(e,this.session,this.dialect)}insert(e){return new p$(e,this.session,this.dialect)}delete(e){return new f$(e,this.session,this.dialect)}refreshMaterializedView(e){return new h$(e,this.session,this.dialect)}execute(e){let t=typeof e==`string`?$.raw(e):e.getSQL(),n=this.dialect.sqlToQuery(t),r=this.session.prepareQuery(n,void 0,void 0,!1);return new x$(()=>r.execute(void 0,this.authToken),t,n,e=>r.mapResult(e,!0))}transaction(e,t){return this.session.transaction(e,t)}},e.defineProperty(Wi,Z,`PgDatabase`),Wi),C$=(Gi=class{},e.defineProperty(Gi,Z,`Cache`),Gi),w$=(Ki=class extends C${strategy(){return`all`}async get(e){}async put(e,t,n,r){}async onMutate(e){}},e.defineProperty(Ki,Z,`NoopCache`),Ki);async function T$(e,t){let n=`${e}-${JSON.stringify(t)}`,r=new TextEncoder,i=r.encode(n),a=await crypto.subtle.digest(`SHA-256`,i),o=[...new Uint8Array(a)],s=o.map(e=>e.toString(16).padStart(2,`0`)).join(``);return s}var E$=class e extends Error{constructor(t,n,r){super(`Failed query: ${t} -params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(this,e),r&&(this.cause=r)}},D$=(qi=class{constructor(t,n,r,i){var a;e.defineProperty(this,`authToken`,void 0),e.defineProperty(this,`joinsNotNullableMap`,void 0),this.query=t,this.cache=n,this.queryMetadata=r,this.cacheConfig=i,n&&n.strategy()===`all`&&i===void 0&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),(a=this.cacheConfig)?.enable||(this.cacheConfig=void 0)}getQuery(){return this.query}mapResult(e,t){return e}setToken(e){return this.authToken=e,this}async queryWithCache(e,t,n){if(this.cache===void 0||Q(this.cache,w$)||this.queryMetadata===void 0)try{return await n()}catch(n){throw new E$(e,t,n)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await n()}catch(n){throw new E$(e,t,n)}if((this.queryMetadata.type===`insert`||this.queryMetadata.type===`update`||this.queryMetadata.type===`delete`)&&this.queryMetadata.tables.length>0)try{let[e]=await Promise.all([n(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return e}catch(n){throw new E$(e,t,n)}if(!this.cacheConfig)try{return await n()}catch(n){throw new E$(e,t,n)}if(this.queryMetadata.type===`select`){let r=await this.cache.get(this.cacheConfig.tag??await T$(e,t),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(r===void 0){let r;try{r=await n()}catch(n){throw new E$(e,t,n)}return await this.cache.put(this.cacheConfig.tag??await T$(e,t),r,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),r}return r}try{return await n()}catch(n){throw new E$(e,t,n)}}},e.defineProperty(qi,Z,`PgPreparedQuery`),qi),O$=(Ji=class{constructor(e){this.dialect=e}execute(e,t){return VX.startActiveSpan(`drizzle.operation`,()=>{let n=VX.startActiveSpan(`drizzle.prepareQuery`,()=>this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1));return n.setToken(t).execute(void 0,t)})}all(e){return this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1).all()}async count(e,t){let n=await this.execute(e,t);return Number(n[0].count)}},e.defineProperty(Ji,Z,`PgSession`),Ji),k$=(Yi=class extends S${constructor(e,t,n,r=0){super(e,t,n),this.schema=n,this.nestedIndex=r}rollback(){throw new CZ}getTransactionConfigSQL(e){let t=[];return e.isolationLevel&&t.push(`isolation level ${e.isolationLevel}`),e.accessMode&&t.push(e.accessMode),typeof e.deferrable==`boolean`&&t.push(e.deferrable?`deferrable`:`not deferrable`),$.raw(t.join(` `))}setTransaction(e){return this.session.execute($`set transaction ${this.getTransactionConfigSQL(e)}`)}},e.defineProperty(Yi,Z,`PgTransaction`),Yi);function A$(e){return typeof e==`string`&&/^true$/i.test(e)}function j$(e){let t={scheme:`duckdb-wasm:`},n=new URL(e);if(!n.protocol.startsWith(`duckdb-wasm:`))throw Error(`Expected scheme to be "duckdb-wasm:" but got "${n.protocol}"`);n.searchParams.get(`bundles`)===`import-url`&&(t.bundles=`import-url`);let r=n.searchParams.get(`logger`);r&&A$(r)&&(t.logger=!0);let i=n.searchParams.get(`storage`);switch(i){case aX.ORIGIN_PRIVATE_FS:{n.host.length>0&&console.warn(`Host "${n.host}" will be ignored while using Origin Private FS`);let e=n.searchParams.get(`write`);t.storage={type:aX.ORIGIN_PRIVATE_FS,path:n.pathname.startsWith(`/`)?n.pathname.slice(1):n.pathname,...e&&A$(e)&&{accessMode:TB.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var M$=(Xi=class extends D${constructor(e,t,n,r,i,a){super({sql:t,params:n}),this.client=e,this.queryString=t,this.params=n,this.logger=r,this.fields=i,this.customResultMapper=a}async execute(e={}){let t=fZ(this.params,e);this.logger.logQuery(this.queryString,t);let{fields:n,queryString:r,client:i,customResultMapper:a}=this,o=await i;return o.query(r,t)}async all(e={}){let t=fZ(this.params,e);this.logger.logQuery(this.queryString,t);let n=await this.client;return n.query(this.queryString,t)}},e.defineProperty(Xi,Z,`DuckDBWasmPreparedQuery`),Xi),N$=(Zi=class t extends O${constructor(t,n,r,i={}){super(n),e.defineProperty(this,`logger`,void 0),this.client=t,this.schema=r,this.options=i,this.logger=i.logger??new EZ}prepareQuery(e,t,n,r,i){return new M$(this.client,e.sql,e.params,this.logger,t,i)}async query(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}async queryObjects(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}transaction(e,n){return sX(this.client,async r=>{let i=new t(r,this.dialect,this.schema,this.options),a=new P$(this.dialect,i,this.schema);return n&&await a.setTransaction(n),e(a)})}},e.defineProperty(Zi,Z,`DuckDBWasmSession`),Zi),P$=(Qi=class t extends k${constructor(t,n,r,i=0){super(t,n,r,i),e.defineProperty(this,`dialect`,void 0),e.defineProperty(this,`session`,void 0),this.dialect=t,this.session=n}async transaction(e){return cX(this.session.client,``,async n=>{let r=new N$(n,this.dialect,this.schema,this.session.options),i=new t(this.dialect,r,this.schema);return e(i)})}},e.defineProperty(Qi,Z,`DuckDBWasmTransaction`),Qi),F$=($i=class extends S${},e.defineProperty($i,Z,`DuckDBWasmDatabase`),$i);function I$(e,t={}){let n=new ZQ({casing:t.casing}),r;t.logger===!0?r=new TZ:t.logger!==!1&&(r=t.logger);let i;if(t.schema){let e=zQ(t.schema,UQ);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new N$(e,n,i,{logger:r}),o=new F$(n,a,i);return o.$client=e,o}function L$(e,t){let n=j$(e),r;if(n.bundles===`import-url`){let e=async()=>{let e=await MY();switch(e){case`browser`:return(await Et(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-browser-CajlDqRn.js`);return{getImportUrlBundles:e}},__vite__mapDeps([5,6,7]))).getImportUrlBundles();case`node`:return await(await Et(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-node-BGiLk3V8.js`);return{getImportUrlBundles:e}},__vite__mapDeps([8,7]))).getImportUrlBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}else{let e=async()=>{let e=await MY();switch(e){case`browser`:return(await Et(async()=>{let{getBundles:e}=await import(`./default-browser-DTRWbcB3.js`);return{getBundles:e}},[])).getBundles();case`node`:return await(await Et(async()=>{let{getBundles:e}=await import(`./default-node-G9zSbWb2.js`);return{getBundles:e}},__vite__mapDeps([4,2,3]))).getBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}return I$(oX({bundles:r,logger:n.logger?new MB:void 0,storage:n.storage}),t)}function R$(...e){if(typeof e[0]==`string`)return L$(e[0],e[1]);if(PZ(e[0])){let{connection:t,client:n,...r}=e[0];if(n)return I$(n,r);if(typeof t==`string`)return L$(t,r);if(t===void 0)throw Error(`connection option is required`);return I$(oX({bundles:t.bundles,logger:t.logger,storage:t.storage}),r)}return I$(e[0],e[1])}(function(e){function t(e){return I$({options:{parsers:{},serializers:{}}},e)}e.mock=t})(R$||={});const z$={relative:``},B$={"h-full":``,"w-full":``},V$={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`},H$={bg:`primary-50`,"rounded-xl":``,"px-10":``,"py-6":``},U$=[`innerHTML`];var W$=H({__name:`Stage`,props:{paused:{type:Boolean,default:!1},focusAt:null},setup(e){let t=W(),n=W(),{stageView:r}=ln(Cn()),{mouthOpenSize:i}=ln(Vn()),{audioContext:a,calculateVolume:o}=Rn(),{onBeforeMessageComposed:s,onBeforeSend:c,onTokenLiteral:l,onTokenSpecial:u,onStreamEnd:d,streamingMessage:f,onAssistantResponseEnd:p}=zn(),{process:m}=rr(),h=Bn(),g=W(),_=W(!1),v=W(!1),y=ar({handlers:[e=>new Promise(t=>{let n=a.createBufferSource();n.buffer=e.data.audioBuffer,n.connect(a.destination),n.connect(g.value),_.value=!0,n.start(0),n.onended=()=>{_.value=!1,t()}})]}),b=Hn(),{ssmlEnabled:x,activeSpeechProvider:S,activeSpeechModel:C,activeSpeechVoice:w,pitch:T}=ln(b);async function E(e){try{if(!S.value){console.warn(`No active speech provider configured`);return}if(!w.value){console.warn(`No active speech voice configured`);return}let t=h.getProviderInstance(S.value);if(!t){console.error(`Failed to initialize speech provider`);return}let n=h.getProviderConfig(S.value),r=x.value?b.generateSSML(e.data,w.value,{...n,pitch:T.value}):e.data,i=await Ln({...t.speech(C.value,n),input:r,voice:w.value.id}),o=await a.decodeAudioData(i);await y.add({audioBuffer:o,text:e.data})}catch(e){console.error(`Speech generation failed:`,e)}}let D=ar({handlers:[E]});D.on(`add`,e=>{console.debug(`ttsQueue added`,e)});let O=fr(D),{live2dCurrentMotion:k}=ln(Cn()),A=ar({handlers:[async e=>{if(r.value===`3d`){let t=sr[e.data];if(!t)return;await n.value.setExpression(t)}else r.value===`2d`&&(k.value={group:or[e.data]})}]}),j=dr(A);j.onHandlerEvent(`emotion`,e=>{console.debug(`emotion detected`,e)});let M=ur();M.onHandlerEvent(`delay`,e=>{console.debug(`delay detected`,e)});function N(){requestAnimationFrame(N),_.value&&(i.value=o(g.value,`linear`))}function ee(){v.value||(N(),a.resume(),v.value=!0)}function P(){g.value||=a.createAnalyser()}return s(async()=>{P(),ee()}),c(async()=>{k.value={group:cr}}),l(async e=>{await O.add(e)}),u(async e=>{await M.add(e),await j.add(e)}),d(async()=>{await M.add(lr)}),p(async e=>{}),Zt(()=>{v.value=!1}),Yt(async()=>{t.value=R$({connection:{bundles:In()}}),await t.value.execute(`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(t,a)=>(U(),V(`div`,z$,[B(`div`,B$,[G(r)===`2d`?(U(),kt(yb,{key:0,"focus-at":e.focusAt,"mouth-open-size":G(i),"min-w":`50% 0)try{let[e]=await Promise.all([n(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return e}catch(n){throw new E$(e,t,n)}if(!this.cacheConfig)try{return await n()}catch(n){throw new E$(e,t,n)}if(this.queryMetadata.type===`select`){let r=await this.cache.get(this.cacheConfig.tag??await T$(e,t),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(r===void 0){let r;try{r=await n()}catch(n){throw new E$(e,t,n)}return await this.cache.put(this.cacheConfig.tag??await T$(e,t),r,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),r}return r}try{return await n()}catch(n){throw new E$(e,t,n)}}},e.defineProperty(qi,Z,`PgPreparedQuery`),qi),O$=(Ji=class{constructor(e){this.dialect=e}execute(e,t){return VX.startActiveSpan(`drizzle.operation`,()=>{let n=VX.startActiveSpan(`drizzle.prepareQuery`,()=>this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1));return n.setToken(t).execute(void 0,t)})}all(e){return this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1).all()}async count(e,t){let n=await this.execute(e,t);return Number(n[0].count)}},e.defineProperty(Ji,Z,`PgSession`),Ji),k$=(Yi=class extends S${constructor(e,t,n,r=0){super(e,t,n),this.schema=n,this.nestedIndex=r}rollback(){throw new CZ}getTransactionConfigSQL(e){let t=[];return e.isolationLevel&&t.push(`isolation level ${e.isolationLevel}`),e.accessMode&&t.push(e.accessMode),typeof e.deferrable==`boolean`&&t.push(e.deferrable?`deferrable`:`not deferrable`),$.raw(t.join(` `))}setTransaction(e){return this.session.execute($`set transaction ${this.getTransactionConfigSQL(e)}`)}},e.defineProperty(Yi,Z,`PgTransaction`),Yi);function A$(e){return typeof e==`string`&&/^true$/i.test(e)}function j$(e){let t={scheme:`duckdb-wasm:`},n=new URL(e);if(!n.protocol.startsWith(`duckdb-wasm:`))throw Error(`Expected scheme to be "duckdb-wasm:" but got "${n.protocol}"`);n.searchParams.get(`bundles`)===`import-url`&&(t.bundles=`import-url`);let r=n.searchParams.get(`logger`);r&&A$(r)&&(t.logger=!0);let i=n.searchParams.get(`storage`);switch(i){case aX.ORIGIN_PRIVATE_FS:{n.host.length>0&&console.warn(`Host "${n.host}" will be ignored while using Origin Private FS`);let e=n.searchParams.get(`write`);t.storage={type:aX.ORIGIN_PRIVATE_FS,path:n.pathname.startsWith(`/`)?n.pathname.slice(1):n.pathname,...e&&A$(e)&&{accessMode:TB.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var M$=(Xi=class extends D${constructor(e,t,n,r,i,a){super({sql:t,params:n}),this.client=e,this.queryString=t,this.params=n,this.logger=r,this.fields=i,this.customResultMapper=a}async execute(e={}){let t=fZ(this.params,e);this.logger.logQuery(this.queryString,t);let{fields:n,queryString:r,client:i,customResultMapper:a}=this,o=await i;return o.query(r,t)}async all(e={}){let t=fZ(this.params,e);this.logger.logQuery(this.queryString,t);let n=await this.client;return n.query(this.queryString,t)}},e.defineProperty(Xi,Z,`DuckDBWasmPreparedQuery`),Xi),N$=(Zi=class t extends O${constructor(t,n,r,i={}){super(n),e.defineProperty(this,`logger`,void 0),this.client=t,this.schema=r,this.options=i,this.logger=i.logger??new EZ}prepareQuery(e,t,n,r,i){return new M$(this.client,e.sql,e.params,this.logger,t,i)}async query(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}async queryObjects(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}transaction(e,n){return sX(this.client,async r=>{let i=new t(r,this.dialect,this.schema,this.options),a=new P$(this.dialect,i,this.schema);return n&&await a.setTransaction(n),e(a)})}},e.defineProperty(Zi,Z,`DuckDBWasmSession`),Zi),P$=(Qi=class t extends k${constructor(t,n,r,i=0){super(t,n,r,i),e.defineProperty(this,`dialect`,void 0),e.defineProperty(this,`session`,void 0),this.dialect=t,this.session=n}async transaction(e){return cX(this.session.client,``,async n=>{let r=new N$(n,this.dialect,this.schema,this.session.options),i=new t(this.dialect,r,this.schema);return e(i)})}},e.defineProperty(Qi,Z,`DuckDBWasmTransaction`),Qi),F$=($i=class extends S${},e.defineProperty($i,Z,`DuckDBWasmDatabase`),$i);function I$(e,t={}){let n=new ZQ({casing:t.casing}),r;t.logger===!0?r=new TZ:t.logger!==!1&&(r=t.logger);let i;if(t.schema){let e=zQ(t.schema,UQ);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new N$(e,n,i,{logger:r}),o=new F$(n,a,i);return o.$client=e,o}function L$(e,t){let n=j$(e),r;if(n.bundles===`import-url`){let e=async()=>{let e=await MY();switch(e){case`browser`:return(await Et(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-browser-CajlDqRn.js`);return{getImportUrlBundles:e}},__vite__mapDeps([5,6,7]))).getImportUrlBundles();case`node`:return await(await Et(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-node-BGiLk3V8.js`);return{getImportUrlBundles:e}},__vite__mapDeps([8,7]))).getImportUrlBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}else{let e=async()=>{let e=await MY();switch(e){case`browser`:return(await Et(async()=>{let{getBundles:e}=await import(`./default-browser-DTRWbcB3.js`);return{getBundles:e}},[])).getBundles();case`node`:return await(await Et(async()=>{let{getBundles:e}=await import(`./default-node-q82Mf43j.js`);return{getBundles:e}},__vite__mapDeps([4,2,3]))).getBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}return I$(oX({bundles:r,logger:n.logger?new MB:void 0,storage:n.storage}),t)}function R$(...e){if(typeof e[0]==`string`)return L$(e[0],e[1]);if(PZ(e[0])){let{connection:t,client:n,...r}=e[0];if(n)return I$(n,r);if(typeof t==`string`)return L$(t,r);if(t===void 0)throw Error(`connection option is required`);return I$(oX({bundles:t.bundles,logger:t.logger,storage:t.storage}),r)}return I$(e[0],e[1])}(function(e){function t(e){return I$({options:{parsers:{},serializers:{}}},e)}e.mock=t})(R$||={});const z$={relative:``},B$={"h-full":``,"w-full":``},V$={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`},H$={bg:`primary-50`,"rounded-xl":``,"px-10":``,"py-6":``},U$=[`innerHTML`];var W$=H({__name:`Stage`,props:{paused:{type:Boolean,default:!1},focusAt:null},setup(e){let t=W(),n=W(),{stageView:r}=ln(Cn()),{mouthOpenSize:i}=ln(Vn()),{audioContext:a,calculateVolume:o}=Rn(),{onBeforeMessageComposed:s,onBeforeSend:c,onTokenLiteral:l,onTokenSpecial:u,onStreamEnd:d,streamingMessage:f,onAssistantResponseEnd:p}=zn(),{process:m}=rr(),h=Bn(),g=W(),_=W(!1),v=W(!1),y=ar({handlers:[e=>new Promise(t=>{let n=a.createBufferSource();n.buffer=e.data.audioBuffer,n.connect(a.destination),n.connect(g.value),_.value=!0,n.start(0),n.onended=()=>{_.value=!1,t()}})]}),b=Hn(),{ssmlEnabled:x,activeSpeechProvider:S,activeSpeechModel:C,activeSpeechVoice:w,pitch:T}=ln(b);async function E(e){try{if(!S.value){console.warn(`No active speech provider configured`);return}if(!w.value){console.warn(`No active speech voice configured`);return}let t=h.getProviderInstance(S.value);if(!t){console.error(`Failed to initialize speech provider`);return}let n=h.getProviderConfig(S.value),r=x.value?b.generateSSML(e.data,w.value,{...n,pitch:T.value}):e.data,i=await Ln({...t.speech(C.value,n),input:r,voice:w.value.id}),o=await a.decodeAudioData(i);await y.add({audioBuffer:o,text:e.data})}catch(e){console.error(`Speech generation failed:`,e)}}let D=ar({handlers:[E]});D.on(`add`,e=>{console.debug(`ttsQueue added`,e)});let O=fr(D),{live2dCurrentMotion:k}=ln(Cn()),A=ar({handlers:[async e=>{if(r.value===`3d`){let t=sr[e.data];if(!t)return;await n.value.setExpression(t)}else r.value===`2d`&&(k.value={group:or[e.data]})}]}),j=dr(A);j.onHandlerEvent(`emotion`,e=>{console.debug(`emotion detected`,e)});let M=ur();M.onHandlerEvent(`delay`,e=>{console.debug(`delay detected`,e)});function N(){requestAnimationFrame(N),_.value&&(i.value=o(g.value,`linear`))}function ee(){v.value||(N(),a.resume(),v.value=!0)}function P(){g.value||=a.createAnalyser()}return s(async()=>{P(),ee()}),c(async()=>{k.value={group:cr}}),l(async e=>{await O.add(e)}),u(async e=>{await M.add(e),await j.add(e)}),d(async()=>{await M.add(lr)}),p(async e=>{}),Zt(()=>{v.value=!1}),Yt(async()=>{t.value=R$({connection:{bundles:In()}}),await t.value.execute(`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(t,a)=>(U(),V(`div`,z$,[B(`div`,B$,[G(r)===`2d`?(U(),kt(yb,{key:0,"focus-at":e.focusAt,"mouth-open-size":G(i),"min-w":`50% =array.length-1?``:array[index$1+offset]}function useLlmmarkerParser(options){let state=States.Literal,buffer=``;return{async consume(textPart){for(let i=0;i`?(current+=peek(textPart,i,1),newState=States.Literal,i++):current===`<`?newState=States.Special:current===`>`&&(newState=States.Literal),state===States.Literal&&newState===States.Special){if(buffer!==``){var _options$onLiteral;await(_options$onLiteral=options.onLiteral)?.call(options,buffer),buffer=``}}else if(state===States.Special&&newState===States.Literal&&buffer!==``){var _options$onSpecial;buffer+=current,await(_options$onSpecial=options.onSpecial)?.call(options,buffer),buffer=``}if(state===States.Literal&&newState===States.Literal){var _options$onLiteral2;await(_options$onLiteral2=options.onLiteral)?.call(options,current),buffer=``}else state===States.Special&&newState===States.Literal?buffer=``:buffer+=current;state=newState}},async end(){if(buffer!==``){var _options$onLiteral3,_options$onSpecial2;state===States.Literal?await(_options$onLiteral3=options.onLiteral)?.call(options,buffer):buffer.endsWith(`|>`)&&await(_options$onSpecial2=options.onSpecial)?.call(options,buffer)}}}}const htmlVoidElements=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];var Schema=class{constructor(property,normal,space$1){this.normal=normal,this.property=property,space$1&&(this.space=space$1)}};Schema.prototype.normal={},Schema.prototype.property={},Schema.prototype.space=void 0;function merge(definitions,space$1){let property={},normal={};for(let definition$1 of definitions)Object.assign(property,definition$1.property),Object.assign(normal,definition$1.normal);return new Schema(property,normal,space$1)}function normalize$1(value){return value.toLowerCase()}var Info=class{constructor(property,attribute){this.attribute=attribute,this.property=property}};Info.prototype.attribute=``,Info.prototype.booleanish=!1,Info.prototype.boolean=!1,Info.prototype.commaOrSpaceSeparated=!1,Info.prototype.commaSeparated=!1,Info.prototype.defined=!1,Info.prototype.mustUseProperty=!1,Info.prototype.number=!1,Info.prototype.overloadedBoolean=!1,Info.prototype.property=``,Info.prototype.spaceSeparated=!1,Info.prototype.space=void 0;var types_exports={};__export(types_exports,{boolean:()=>boolean,booleanish:()=>booleanish,commaOrSpaceSeparated:()=>commaOrSpaceSeparated,commaSeparated:()=>commaSeparated,number:()=>number,overloadedBoolean:()=>overloadedBoolean,spaceSeparated:()=>spaceSeparated});let powers=0;const boolean=increment(),booleanish=increment(),overloadedBoolean=increment(),number=increment(),spaceSeparated=increment(),commaSeparated=increment(),commaOrSpaceSeparated=increment();function increment(){return 2**++powers}const checks=Object.keys(types_exports);var DefinedInfo=class extends Info{constructor(property,attribute,mask,space$1){let index$1=-1;if(super(property,attribute),mark(this,`space`,space$1),typeof mask==`number`)for(;++index$14&&normal.slice(0,4)===`data`&&valid.test(value)){if(value.charAt(4)===`-`){let rest=value.slice(5).replace(dash,camelcase);property=`data`+rest.charAt(0).toUpperCase()+rest.slice(1)}else{let rest=value.slice(4);if(!dash.test(rest)){let dashes=rest.replace(cap,kebab);dashes.charAt(0)!==`-`&&(dashes=`-`+dashes),value=`data`+dashes}}Type=DefinedInfo}return new Type(property,value)}function kebab($0){return`-`+$0.toLowerCase()}function camelcase($0){return $0.charAt(1).toUpperCase()}const html$1=merge([aria,html$4,xlink,xmlns,xml],`html`),svg=merge([aria,svg$1,xlink,xmlns,xml],`svg`),own$5={}.hasOwnProperty;function zwitch(key$1,options){let settings=options||{};function one$2(value,...parameters){let fn=one$2.invalid,handlers$1=one$2.handlers;if(value&&own$5.call(value,key$1)){let id=String(value[key$1]);fn=own$5.call(handlers$1,id)?handlers$1[id]:one$2.unknown}if(fn)return fn.call(this,value,...parameters)}return one$2.handlers=settings.handlers||{},one$2.invalid=settings.invalid,one$2.unknown=settings.unknown,one$2}const defaultSubsetRegex=/["&'<>`]/g,surrogatePairsRegex=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,controlCharactersRegex=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,regexEscapeRegex=/[|\\{}()[\]^$+*?.]/g,subsetToRegexCache=new WeakMap;function core(value,options){if(value=value.replace(options.subset?charactersToExpressionCached(options.subset):defaultSubsetRegex,basic),options.subset||options.escapeOnly)return value;return value.replace(surrogatePairsRegex,surrogate).replace(controlCharactersRegex,basic);function surrogate(pair,index$1,all$2){return options.format((pair.charCodeAt(0)-55296)*1024+pair.charCodeAt(1)-56320+65536,all$2.charCodeAt(index$1+2),options)}function basic(character,index$1,all$2){return options.format(character.charCodeAt(0),all$2.charCodeAt(index$1+1),options)}}function charactersToExpressionCached(subset){let cached=subsetToRegexCache.get(subset);return cached||(cached=charactersToExpression(subset),subsetToRegexCache.set(subset,cached)),cached}function charactersToExpression(subset){let groups=[],index$1=-1;for(;++index$1`,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:`€`},dangerous=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],own$4={}.hasOwnProperty,characters={};let key;for(key in characterEntitiesHtml4)own$4.call(characterEntitiesHtml4,key)&&(characters[characterEntitiesHtml4[key]]=key);const notAlphanumericRegex=/[^\dA-Za-z]/;function toNamed(code$1,next,omit,attribute){let character=String.fromCharCode(code$1);if(own$4.call(characters,character)){let name$1=characters[character],value=`&`+name$1;return omit&&characterEntitiesLegacy.includes(name$1)&&!dangerous.includes(name$1)&&(!attribute||next&&next!==61&¬AlphanumericRegex.test(String.fromCharCode(next)))?value:value+`;`}return``}function formatSmart(code$1,next,options){let numeric=toHexadecimal(code$1,next,options.omitOptionalSemicolons),named;if((options.useNamedReferences||options.useShortestReferences)&&(named=toNamed(code$1,next,options.omitOptionalSemicolons,options.attribute)),(options.useShortestReferences||!named)&&options.useShortestReferences){let decimal=toDecimal(code$1,next,options.omitOptionalSemicolons);decimal.length|^->||--!>|`],commentEntitySubset=[`<`,`>`];function comment(node$1,_1,_2,state){return state.settings.bogusComments?``:``;function encode($0){return stringifyEntities($0,Object.assign({},state.settings.characterReferences,{subset:commentEntitySubset}))}}function doctype(_1,_2,_3,state){return``}function ccount(value,character){let source=String(value);if(typeof character!=`string`)throw TypeError(`Expected character`);let count=0,index$1=source.indexOf(character);for(;index$1!==-1;)count++,index$1=source.indexOf(character,index$1+character.length);return count}function stringify(values,options){let settings=options||{},input=values[values.length-1]===``?[...values,``]:values;return input.join((settings.padRight?` `:``)+`,`+(settings.padLeft===!1?``:` `)).trim()}function stringify$1(values){return values.join(` `).trim()}const re=/[ \t\n\f\r]/g;function whitespace(thing){return typeof thing==`object`?thing.type===`text`?empty$1(thing.value):!1:empty$1(thing)}function empty$1(value){return value.replace(re,``)===``}const siblingAfter=siblings(1),siblingBefore=siblings(-1),emptyChildren$1=[];function siblings(increment$1){return sibling;function sibling(parent,index$1,includeWhitespace){let siblings$1=parent?parent.children:emptyChildren$1,offset=(index$1||0)+increment$1,next=siblings$1[offset];if(!includeWhitespace)for(;next&&whitespace(next);)offset+=increment$1,next=siblings$1[offset];return next}}const own$3={}.hasOwnProperty;function omission(handlers$1){return omit;function omit(node$1,index$1,parent){return own$3.call(handlers$1,node$1.tagName)&&handlers$1[node$1.tagName](node$1,index$1,parent)}}const closing=omission({body:body$1,caption:headOrColgroupOrCaption,colgroup:headOrColgroupOrCaption,dd,dt,head:headOrColgroupOrCaption,html:html$3,li,optgroup,option,p,rp:rubyElement,rt:rubyElement,tbody:tbody$1,td:cells,tfoot,th:cells,thead,tr});function headOrColgroupOrCaption(_,index$1,parent){let next=siblingAfter(parent,index$1,!0);return!next||next.type!==`comment`&&!(next.type===`text`&&whitespace(next.value.charAt(0)))}function html$3(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type!==`comment`}function body$1(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type!==`comment`}function p(_,index$1,parent){let next=siblingAfter(parent,index$1);return next?next.type===`element`&&(next.tagName===`address`||next.tagName===`article`||next.tagName===`aside`||next.tagName===`blockquote`||next.tagName===`details`||next.tagName===`div`||next.tagName===`dl`||next.tagName===`fieldset`||next.tagName===`figcaption`||next.tagName===`figure`||next.tagName===`footer`||next.tagName===`form`||next.tagName===`h1`||next.tagName===`h2`||next.tagName===`h3`||next.tagName===`h4`||next.tagName===`h5`||next.tagName===`h6`||next.tagName===`header`||next.tagName===`hgroup`||next.tagName===`hr`||next.tagName===`main`||next.tagName===`menu`||next.tagName===`nav`||next.tagName===`ol`||next.tagName===`p`||next.tagName===`pre`||next.tagName===`section`||next.tagName===`table`||next.tagName===`ul`):!parent||!(parent.type===`element`&&(parent.tagName===`a`||parent.tagName===`audio`||parent.tagName===`del`||parent.tagName===`ins`||parent.tagName===`map`||parent.tagName===`noscript`||parent.tagName===`video`))}function li(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&next.tagName===`li`}function dt(_,index$1,parent){let next=siblingAfter(parent,index$1);return!!(next&&next.type===`element`&&(next.tagName===`dt`||next.tagName===`dd`))}function dd(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`dt`||next.tagName===`dd`)}function rubyElement(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`rp`||next.tagName===`rt`)}function optgroup(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&next.tagName===`optgroup`}function option(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`option`||next.tagName===`optgroup`)}function thead(_,index$1,parent){let next=siblingAfter(parent,index$1);return!!(next&&next.type===`element`&&(next.tagName===`tbody`||next.tagName===`tfoot`))}function tbody$1(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`tbody`||next.tagName===`tfoot`)}function tfoot(_,index$1,parent){return!siblingAfter(parent,index$1)}function tr(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&next.tagName===`tr`}function cells(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`td`||next.tagName===`th`)}const opening=omission({body,colgroup,head,html:html$2,tbody});function html$2(node$1){let head$1=siblingAfter(node$1,-1);return!head$1||head$1.type!==`comment`}function head(node$1){let seen=new Set;for(let child$1 of node$1.children)if(child$1.type===`element`&&(child$1.tagName===`base`||child$1.tagName===`title`)){if(seen.has(child$1.tagName))return!1;seen.add(child$1.tagName)}let child=node$1.children[0];return!child||child.type===`element`}function body(node$1){let head$1=siblingAfter(node$1,-1,!0);return!head$1||head$1.type!==`comment`&&!(head$1.type===`text`&&whitespace(head$1.value.charAt(0)))&&!(head$1.type===`element`&&(head$1.tagName===`meta`||head$1.tagName===`link`||head$1.tagName===`script`||head$1.tagName===`style`||head$1.tagName===`template`))}function colgroup(node$1,index$1,parent){let previous$1=siblingBefore(parent,index$1),head$1=siblingAfter(node$1,-1,!0);return parent&&previous$1&&previous$1.type===`element`&&previous$1.tagName===`colgroup`&&closing(previous$1,parent.children.indexOf(previous$1),parent)?!1:!!(head$1&&head$1.type===`element`&&head$1.tagName===`col`)}function tbody(node$1,index$1,parent){let previous$1=siblingBefore(parent,index$1),head$1=siblingAfter(node$1,-1);return parent&&previous$1&&previous$1.type===`element`&&(previous$1.tagName===`thead`||previous$1.tagName===`tbody`)&&closing(previous$1,parent.children.indexOf(previous$1),parent)?!1:!!(head$1&&head$1.type===`element`&&head$1.tagName===`tr`)}const constants={name:[[` +import{AnimationClip,AxesHelper,BackSide,Bone,Box3,BufferAttribute,BufferGeometry,ClampToEdgeWrapping,Color,ColorManagement,DirectionalLight,DoubleSide,DynamicDrawUsage,Euler,FileLoader,FrontSide,GLBufferAttribute,Group,ImageBitmapLoader,ImageLoader,InstancedBufferAttribute,InstancedMesh,InterleavedBuffer,InterleavedBufferAttribute,Interpolant,InterpolateDiscrete,InterpolateLinear,Line,LineBasicMaterial,LineLoop,LineSegments,LinearFilter,LinearMipmapLinearFilter,LinearMipmapNearestFilter,LinearSRGBColorSpace,Loader,LoaderUtils,Material,MathUtils,Matrix3,Matrix4,Mesh,MeshBasicMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MirroredRepeatWrapping,NearestFilter,NearestMipmapLinearFilter,NearestMipmapNearestFilter,NumberKeyframeTrack,Object3D,OrthographicCamera,PerspectiveCamera,PointLight,Points,PointsMaterial,PropertyBinding,Quaternion,QuaternionKeyframeTrack,REVISION,RepeatWrapping,SRGBColorSpace,ShaderMaterial,Skeleton,SkinnedMesh,Sphere,SpotLight,TangentSpaceNormalMap,Texture,TextureLoader,TriangleFanDrawMode,TriangleStripDrawMode,TrianglesDrawMode,UniformsLib,UniformsUtils,Vector2,Vector3,VectorKeyframeTrack,__commonJSMin,__esmMin,__export,__toCommonJS,__toESM,onUnmounted,ref,toRef,tryOnMounted,unref,usePermission,useWebWorker,watch}from"./index-DKziOBM4.js";const DEG2RAD=Math.PI/180,RAD2DEG$1=180/Math.PI;function lerp(x,y,t){return(1-t)*x+t*y}function randFloat(low,high){return low+Math.random()*(high-low)}const EYE_SACCADE_INT_STEP=400,EYE_SACCADE_INT_P=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let i=1;ivalue!=null&&Object.getPrototypeOf(value)===Object.prototype,merge=(defaults,user)=>{let merged={...defaults};if(!user)return merged;for(let[key$1,value]of Object.entries(user)){if(value===void 0)continue;if(isPlainObject$2(merged[key$1])&&isPlainObject$2(value)){merged[key$1]=merge(merged[key$1],value);continue}merged[key$1]=value}return merged};var States=function(States$1){return States$1.Literal=`literal`,States$1.Special=`special`,States$1}(States||{});function peek(array,index$1,offset){return index$1+offset<0||index$1+offset>=array.length-1?``:array[index$1+offset]}function useLlmmarkerParser(options){let state=States.Literal,buffer=``;return{async consume(textPart){for(let i=0;i`?(current+=peek(textPart,i,1),newState=States.Literal,i++):current===`<`?newState=States.Special:current===`>`&&(newState=States.Literal),state===States.Literal&&newState===States.Special){if(buffer!==``){var _options$onLiteral;await(_options$onLiteral=options.onLiteral)?.call(options,buffer),buffer=``}}else if(state===States.Special&&newState===States.Literal&&buffer!==``){var _options$onSpecial;buffer+=current,await(_options$onSpecial=options.onSpecial)?.call(options,buffer),buffer=``}if(state===States.Literal&&newState===States.Literal){var _options$onLiteral2;await(_options$onLiteral2=options.onLiteral)?.call(options,current),buffer=``}else state===States.Special&&newState===States.Literal?buffer=``:buffer+=current;state=newState}},async end(){if(buffer!==``){var _options$onLiteral3,_options$onSpecial2;state===States.Literal?await(_options$onLiteral3=options.onLiteral)?.call(options,buffer):buffer.endsWith(`|>`)&&await(_options$onSpecial2=options.onSpecial)?.call(options,buffer)}}}}const htmlVoidElements=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];var Schema=class{constructor(property,normal,space$1){this.normal=normal,this.property=property,space$1&&(this.space=space$1)}};Schema.prototype.normal={},Schema.prototype.property={},Schema.prototype.space=void 0;function merge$1(definitions,space$1){let property={},normal={};for(let definition$1 of definitions)Object.assign(property,definition$1.property),Object.assign(normal,definition$1.normal);return new Schema(property,normal,space$1)}function normalize$1(value){return value.toLowerCase()}var Info=class{constructor(property,attribute){this.attribute=attribute,this.property=property}};Info.prototype.attribute=``,Info.prototype.booleanish=!1,Info.prototype.boolean=!1,Info.prototype.commaOrSpaceSeparated=!1,Info.prototype.commaSeparated=!1,Info.prototype.defined=!1,Info.prototype.mustUseProperty=!1,Info.prototype.number=!1,Info.prototype.overloadedBoolean=!1,Info.prototype.property=``,Info.prototype.spaceSeparated=!1,Info.prototype.space=void 0;var types_exports={};__export(types_exports,{boolean:()=>boolean,booleanish:()=>booleanish,commaOrSpaceSeparated:()=>commaOrSpaceSeparated,commaSeparated:()=>commaSeparated,number:()=>number,overloadedBoolean:()=>overloadedBoolean,spaceSeparated:()=>spaceSeparated});let powers=0;const boolean=increment(),booleanish=increment(),overloadedBoolean=increment(),number=increment(),spaceSeparated=increment(),commaSeparated=increment(),commaOrSpaceSeparated=increment();function increment(){return 2**++powers}const checks=Object.keys(types_exports);var DefinedInfo=class extends Info{constructor(property,attribute,mask,space$1){let index$1=-1;if(super(property,attribute),mark(this,`space`,space$1),typeof mask==`number`)for(;++index$14&&normal.slice(0,4)===`data`&&valid.test(value)){if(value.charAt(4)===`-`){let rest=value.slice(5).replace(dash,camelcase);property=`data`+rest.charAt(0).toUpperCase()+rest.slice(1)}else{let rest=value.slice(4);if(!dash.test(rest)){let dashes=rest.replace(cap,kebab);dashes.charAt(0)!==`-`&&(dashes=`-`+dashes),value=`data`+dashes}}Type=DefinedInfo}return new Type(property,value)}function kebab($0){return`-`+$0.toLowerCase()}function camelcase($0){return $0.charAt(1).toUpperCase()}const html$1=merge$1([aria,html$4,xlink,xmlns,xml],`html`),svg=merge$1([aria,svg$1,xlink,xmlns,xml],`svg`),own$5={}.hasOwnProperty;function zwitch(key$1,options){let settings=options||{};function one$2(value,...parameters){let fn=one$2.invalid,handlers$1=one$2.handlers;if(value&&own$5.call(value,key$1)){let id=String(value[key$1]);fn=own$5.call(handlers$1,id)?handlers$1[id]:one$2.unknown}if(fn)return fn.call(this,value,...parameters)}return one$2.handlers=settings.handlers||{},one$2.invalid=settings.invalid,one$2.unknown=settings.unknown,one$2}const defaultSubsetRegex=/["&'<>`]/g,surrogatePairsRegex=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,controlCharactersRegex=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,regexEscapeRegex=/[|\\{}()[\]^$+*?.]/g,subsetToRegexCache=new WeakMap;function core(value,options){if(value=value.replace(options.subset?charactersToExpressionCached(options.subset):defaultSubsetRegex,basic),options.subset||options.escapeOnly)return value;return value.replace(surrogatePairsRegex,surrogate).replace(controlCharactersRegex,basic);function surrogate(pair,index$1,all$2){return options.format((pair.charCodeAt(0)-55296)*1024+pair.charCodeAt(1)-56320+65536,all$2.charCodeAt(index$1+2),options)}function basic(character,index$1,all$2){return options.format(character.charCodeAt(0),all$2.charCodeAt(index$1+1),options)}}function charactersToExpressionCached(subset){let cached=subsetToRegexCache.get(subset);return cached||(cached=charactersToExpression(subset),subsetToRegexCache.set(subset,cached)),cached}function charactersToExpression(subset){let groups=[],index$1=-1;for(;++index$1`,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:`€`},dangerous=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],own$4={}.hasOwnProperty,characters={};let key;for(key in characterEntitiesHtml4)own$4.call(characterEntitiesHtml4,key)&&(characters[characterEntitiesHtml4[key]]=key);const notAlphanumericRegex=/[^\dA-Za-z]/;function toNamed(code$1,next,omit,attribute){let character=String.fromCharCode(code$1);if(own$4.call(characters,character)){let name$1=characters[character],value=`&`+name$1;return omit&&characterEntitiesLegacy.includes(name$1)&&!dangerous.includes(name$1)&&(!attribute||next&&next!==61&¬AlphanumericRegex.test(String.fromCharCode(next)))?value:value+`;`}return``}function formatSmart(code$1,next,options){let numeric=toHexadecimal(code$1,next,options.omitOptionalSemicolons),named;if((options.useNamedReferences||options.useShortestReferences)&&(named=toNamed(code$1,next,options.omitOptionalSemicolons,options.attribute)),(options.useShortestReferences||!named)&&options.useShortestReferences){let decimal=toDecimal(code$1,next,options.omitOptionalSemicolons);decimal.length|^->||--!>|`],commentEntitySubset=[`<`,`>`];function comment(node$1,_1,_2,state){return state.settings.bogusComments?``:``;function encode($0){return stringifyEntities($0,Object.assign({},state.settings.characterReferences,{subset:commentEntitySubset}))}}function doctype(_1,_2,_3,state){return``}function ccount(value,character){let source=String(value);if(typeof character!=`string`)throw TypeError(`Expected character`);let count=0,index$1=source.indexOf(character);for(;index$1!==-1;)count++,index$1=source.indexOf(character,index$1+character.length);return count}function stringify(values,options){let settings=options||{},input=values[values.length-1]===``?[...values,``]:values;return input.join((settings.padRight?` `:``)+`,`+(settings.padLeft===!1?``:` `)).trim()}function stringify$1(values){return values.join(` `).trim()}const re=/[ \t\n\f\r]/g;function whitespace(thing){return typeof thing==`object`?thing.type===`text`?empty$1(thing.value):!1:empty$1(thing)}function empty$1(value){return value.replace(re,``)===``}const siblingAfter=siblings(1),siblingBefore=siblings(-1),emptyChildren$1=[];function siblings(increment$1){return sibling;function sibling(parent,index$1,includeWhitespace){let siblings$1=parent?parent.children:emptyChildren$1,offset=(index$1||0)+increment$1,next=siblings$1[offset];if(!includeWhitespace)for(;next&&whitespace(next);)offset+=increment$1,next=siblings$1[offset];return next}}const own$3={}.hasOwnProperty;function omission(handlers$1){return omit;function omit(node$1,index$1,parent){return own$3.call(handlers$1,node$1.tagName)&&handlers$1[node$1.tagName](node$1,index$1,parent)}}const closing=omission({body:body$1,caption:headOrColgroupOrCaption,colgroup:headOrColgroupOrCaption,dd,dt,head:headOrColgroupOrCaption,html:html$3,li,optgroup,option,p,rp:rubyElement,rt:rubyElement,tbody:tbody$1,td:cells,tfoot,th:cells,thead,tr});function headOrColgroupOrCaption(_,index$1,parent){let next=siblingAfter(parent,index$1,!0);return!next||next.type!==`comment`&&!(next.type===`text`&&whitespace(next.value.charAt(0)))}function html$3(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type!==`comment`}function body$1(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type!==`comment`}function p(_,index$1,parent){let next=siblingAfter(parent,index$1);return next?next.type===`element`&&(next.tagName===`address`||next.tagName===`article`||next.tagName===`aside`||next.tagName===`blockquote`||next.tagName===`details`||next.tagName===`div`||next.tagName===`dl`||next.tagName===`fieldset`||next.tagName===`figcaption`||next.tagName===`figure`||next.tagName===`footer`||next.tagName===`form`||next.tagName===`h1`||next.tagName===`h2`||next.tagName===`h3`||next.tagName===`h4`||next.tagName===`h5`||next.tagName===`h6`||next.tagName===`header`||next.tagName===`hgroup`||next.tagName===`hr`||next.tagName===`main`||next.tagName===`menu`||next.tagName===`nav`||next.tagName===`ol`||next.tagName===`p`||next.tagName===`pre`||next.tagName===`section`||next.tagName===`table`||next.tagName===`ul`):!parent||!(parent.type===`element`&&(parent.tagName===`a`||parent.tagName===`audio`||parent.tagName===`del`||parent.tagName===`ins`||parent.tagName===`map`||parent.tagName===`noscript`||parent.tagName===`video`))}function li(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&next.tagName===`li`}function dt(_,index$1,parent){let next=siblingAfter(parent,index$1);return!!(next&&next.type===`element`&&(next.tagName===`dt`||next.tagName===`dd`))}function dd(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`dt`||next.tagName===`dd`)}function rubyElement(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`rp`||next.tagName===`rt`)}function optgroup(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&next.tagName===`optgroup`}function option(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`option`||next.tagName===`optgroup`)}function thead(_,index$1,parent){let next=siblingAfter(parent,index$1);return!!(next&&next.type===`element`&&(next.tagName===`tbody`||next.tagName===`tfoot`))}function tbody$1(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`tbody`||next.tagName===`tfoot`)}function tfoot(_,index$1,parent){return!siblingAfter(parent,index$1)}function tr(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&next.tagName===`tr`}function cells(_,index$1,parent){let next=siblingAfter(parent,index$1);return!next||next.type===`element`&&(next.tagName===`td`||next.tagName===`th`)}const opening=omission({body,colgroup,head,html:html$2,tbody});function html$2(node$1){let head$1=siblingAfter(node$1,-1);return!head$1||head$1.type!==`comment`}function head(node$1){let seen=new Set;for(let child$1 of node$1.children)if(child$1.type===`element`&&(child$1.tagName===`base`||child$1.tagName===`title`)){if(seen.has(child$1.tagName))return!1;seen.add(child$1.tagName)}let child=node$1.children[0];return!child||child.type===`element`}function body(node$1){let head$1=siblingAfter(node$1,-1,!0);return!head$1||head$1.type!==`comment`&&!(head$1.type===`text`&&whitespace(head$1.value.charAt(0)))&&!(head$1.type===`element`&&(head$1.tagName===`meta`||head$1.tagName===`link`||head$1.tagName===`script`||head$1.tagName===`style`||head$1.tagName===`template`))}function colgroup(node$1,index$1,parent){let previous$1=siblingBefore(parent,index$1),head$1=siblingAfter(node$1,-1,!0);return parent&&previous$1&&previous$1.type===`element`&&previous$1.tagName===`colgroup`&&closing(previous$1,parent.children.indexOf(previous$1),parent)?!1:!!(head$1&&head$1.type===`element`&&head$1.tagName===`col`)}function tbody(node$1,index$1,parent){let previous$1=siblingBefore(parent,index$1),head$1=siblingAfter(node$1,-1);return parent&&previous$1&&previous$1.type===`element`&&(previous$1.tagName===`thead`||previous$1.tagName===`tbody`)&&closing(previous$1,parent.children.indexOf(previous$1),parent)?!1:!!(head$1&&head$1.type===`element`&&head$1.tagName===`tr`)}const constants={name:[[` \f\r &/=>`.split(``),` \f\r "&'/=>\``.split(``)],[`\0 \f\r "&'/<=>`.split(``),`\0 @@ -135,7 +135,7 @@ import{AnimationClip,AxesHelper,BackSide,Bone,Box3,BufferAttribute,BufferGeometr `)}\n return _A(outputIdx);\n }`;return Object.assign(Object.assign({},s),{output:{dims:l$1,type:e$1.type,textureType:a.TextureType.unpacked},shaderSource:f})},c=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Slice requires 1 input.`);if(i.NUMBER_TYPES.indexOf(t$1[0].type)===-1)throw Error(`Invalid input type.`)};e.sliceV10=(t$1,e$1)=>{p$1(e$1);let n$1=l(t$1,e$1);return[t$1.run(Object.assign(Object.assign({},s),{cacheHint:n$1.cacheKey,get:()=>u(t$1,e$1[0],n$1)}),[e$1[0]])]};let l=(t$1,e$1)=>{if(!t$1.session.isInitializer(e$1[1].dataId)||!t$1.session.isInitializer(e$1[2].dataId)||e$1.length>=4&&!t$1.session.isInitializer(e$1[3].dataId)||e$1.length>=5&&!t$1.session.isInitializer(e$1[4].dataId))throw Error(`dynamic slice attributes are not allowed`);if(e$1.length>=5&&e$1[4].integerData.some(t$2=>t$2!==1))throw Error(`currently non-1 steps is not supported for Slice`);let n$1=Array.from(e$1[1].integerData),r$1=Array.from(e$1[2].integerData),i$1=e$1.length>=4?Array.from(e$1[3].integerData):[];return{starts:n$1,ends:r$1,axes:i$1,cacheKey:`${i$1};${n$1};${r$1}`}},p$1=t$1=>{if(!t$1||t$1.length<3||t$1.length>5)throw Error(`Invalid input number.`);if(t$1[1].type!==`int32`||t$1[1].dims.length!==1||t$1[2].type!==`int32`||t$1[2].dims.length!==1||t$1.length>=4&&(t$1[3].type!==`int32`||t$1[3].dims.length!==1)||t$1.length>=5&&(t$1[4].type!==`int32`||t$1[4].dims.length!==1))throw Error(`Invalid input type.`)}},5524:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.softmaxV13=e.parseSoftmaxAttributesV13=e.parseSoftmaxAttributes=e.softmax=void 0;let r=n(246),i=n(2517),o=n(5060),a=n(2039),s=n(3738),u={name:`SoftmaxComputeMax`,inputNames:[`A`],inputTypes:[a.TextureType.unpacked]},c={name:`SoftmaxComputeScale`,inputNames:[`A`,`Max`],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked]},l={name:`SoftMax`,inputNames:[`A`,`Max`,`Norm`],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]};e.softmax=(t$1,e$1,n$1)=>{g(e$1);let r$1=e$1[0].dims.slice(),o$1=i.ShapeUtil.normalizeAxis(n$1.axis,r$1.length),a$1=i.ShapeUtil.sizeToDimension(r$1,o$1),s$1=i.ShapeUtil.sizeFromDimension(r$1,o$1);return p$1(t$1,e$1,n$1,a$1,s$1)},e.parseSoftmaxAttributes=t$1=>(0,r.createAttributeWithCacheKey)({axis:t$1.attributes.getInt(`axis`,1)}),e.parseSoftmaxAttributesV13=t$1=>(0,r.createAttributeWithCacheKey)({axis:t$1.attributes.getInt(`axis`,-1)}),e.softmaxV13=(t$1,e$1,n$1)=>{g(e$1);let o$1=e$1[0].dims.slice(),a$1=i.ShapeUtil.normalizeAxis(n$1.axis,o$1.length),u$1=o$1.length,c$1=a$1!==u$1-1,l$1=[],f$1,d$1=[],h$1=[];c$1&&(d$1=Array.from({length:u$1}).map((t$2,e$2)=>e$2),d$1[a$1]=u$1-1,d$1[u$1-1]=a$1,d$1.map(t$2=>l$1.push(o$1[t$2])),f$1=(0,r.createAttributeWithCacheKey)({perm:d$1}),h$1=(0,s.transpose)(t$1,e$1,f$1));let b=c$1?i.ShapeUtil.sizeToDimension(l$1,u$1-1):i.ShapeUtil.sizeToDimension(o$1,u$1-1),m=c$1?i.ShapeUtil.sizeFromDimension(l$1,u$1-1):i.ShapeUtil.sizeFromDimension(o$1,u$1-1),y=p$1(t$1,c$1?h$1:e$1,n$1,b,m);return c$1?(0,s.transpose)(t$1,y,f$1):y};let p$1=(t$1,e$1,n$1,r$1,i$1)=>{let o$1=f(t$1,e$1[0],r$1,i$1,[r$1]),a$1=t$1.run(Object.assign(Object.assign({},u),{cacheHint:n$1.cacheKey,get:()=>o$1}),e$1),s$1=d(t$1,e$1[0],r$1,i$1,o$1.output.dims,[r$1]),p$2=t$1.run(Object.assign(Object.assign({},c),{cacheHint:n$1.cacheKey,get:()=>s$1}),[e$1[0],a$1]),g$1=h(t$1,e$1[0],r$1,i$1,o$1.output.dims,s$1.output.dims);return[t$1.run(Object.assign(Object.assign({},l),{cacheHint:n$1.cacheKey,get:()=>g$1}),[e$1[0],a$1,p$2])]},f=(t$1,e$1,n$1,r$1,i$1)=>{let[s$1,c$1]=t$1.calculateTextureWidthAndHeight(e$1.dims,a.TextureType.unpacked),l$1=i$1.length;if(n$1<1||r$1<1)throw Error(`Logical row count N and feature count D must be greater than or equal to 1`);if(i$1.length!==1)throw Error(`Dimensionality of the output should be 1`);if(i$1[0]!==n$1)throw Error(`Shape of the output should be equal to logical row count`);let p$2=(0,o.getGlsl)(t$1.session.backend.glContext.version),f$1=`\n float process(int[${l$1}] indices) {\n int logical_row_start_offset = indices[0] * ${r$1};\n\n float max = getColorAsFloat(${p$2.texture2D}(A, offsetToCoords(logical_row_start_offset, ${s$1},\n ${c$1} )));\n for(int i=1; i<${r$1}; ++i)\n {\n float current = getColorAsFloat(${p$2.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${s$1}, ${c$1})));\n if(current > max)\n max = current;\n }\n\n return max;\n }`;return Object.assign(Object.assign({},u),{output:{dims:i$1,type:e$1.type,textureType:a.TextureType.unpacked},shaderSource:f$1})},d=(t$1,e$1,n$1,r$1,i$1,s$1)=>{let[u$1,l$1]=t$1.calculateTextureWidthAndHeight(e$1.dims,a.TextureType.unpacked),p$2=s$1.length;if(n$1<1||r$1<1)throw Error(`Logical row count N and feature count D must be greater than or equal to 1`);if(s$1.length!==1)throw Error(`Dimensionality of the output should be 1`);if(s$1[0]!==n$1)throw Error(`Shape of the output should be equal to logical row count`);if(i$1.length!==1)throw Error(`Dimensionality of the intermediate results should be 1`);if(i$1[0]!==n$1)throw Error(`Shape of the intermediate results should be equal to logical row count`);let f$1=`\n float process(int[${p$2}] indices) {\n int logical_row_start_offset = indices[0] * ${r$1};\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<${r$1}; ++i)\n {\n norm_factor += exp(getColorAsFloat(${(0,o.getGlsl)(t$1.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${u$1}, ${l$1}))) - max);\n }\n\n return norm_factor;\n }`;return Object.assign(Object.assign({},c),{output:{dims:s$1,type:e$1.type,textureType:a.TextureType.unpacked},shaderSource:f$1})},h=(t$1,e$1,n$1,r$1,i$1,o$1)=>{let[s$1,u$1]=t$1.calculateTextureWidthAndHeight(e$1.dims,a.TextureType.unpacked),c$1=e$1.dims.length;if(n$1<1||r$1<1)throw Error(`Logical row count N and feature count D must be greater than or equal to 1`);if(i$1.length!==1||o$1.length!==1)throw Error(`Dimensionality of the intermediate results should be 1`);if(i$1[0]!==n$1||o$1[0]!==n$1)throw Error(`Shape of the intermediate results should be equal to logical row count`);let p$2=`\n float process(int[${c$1}] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ${s$1}, ${u$1});\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ${r$1};\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }`;return Object.assign(Object.assign({},l),{output:{dims:e$1.dims,type:e$1.type,textureType:a.TextureType.unpacked},shaderSource:p$2})},g=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Softmax requires 1 input.`);if(t$1[0].type!==`float32`&&t$1[0].type!==`float64`)throw Error(`Invalid input type`)}},5975:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseSplitAttributes=e.split=void 0;let r=n(246),i=n(2517),o=n(2039),a={name:`Split`,inputNames:[`A`],inputTypes:[o.TextureType.unpacked]};e.split=(t$1,e$1,n$1)=>{c(e$1);let r$1=i.ShapeUtil.normalizeAxis(n$1.axis,e$1[0].dims.length),o$1=s(t$1,e$1,r$1,n$1),l=[];for(let i$1=0;i$1u(t$1,e$1[0],n$1,r$1,i$1)}),e$1));return l},e.parseSplitAttributes=t$1=>{let e$1=t$1.attributes.getInt(`axis`,0),n$1=t$1.attributes.getInts(`split`,[]),i$1=t$1.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:e$1,split:n$1,numOutputs:i$1})};let s=(t$1,e$1,n$1,r$1)=>{let[,o$1]=i.SplitUtil.splitShape(e$1[0].dims,n$1,r$1.split,r$1.numOutputs);return o$1.length},u=(t$1,e$1,n$1,r$1,s$1)=>{let[u$1,c$1]=i.SplitUtil.splitShape(e$1.dims,r$1,n$1.split,n$1.numOutputs),l=c$1[s$1],p$1=u$1[s$1],f=`\n float process(int indices[${p$1.length}]) {\n indices[${r$1}] += ${l};\n return _A(indices);\n }\n `;return Object.assign(Object.assign({},a),{cacheHint:`${n$1.cacheKey}:${s$1}`,output:{dims:p$1,type:e$1.type,textureType:o.TextureType.unpacked},shaderSource:f})},c=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Split requires one input.`);if(t$1[0].type!==`int8`&&t$1[0].type!==`uint8`&&t$1[0].type!==`int16`&&t$1[0].type!==`uint16`&&t$1[0].type!==`int32`&&t$1[0].type!==`uint32`&&t$1[0].type!==`float32`&&t$1[0].type!==`float64`&&t$1[0].type!==`bool`)throw Error(`Invalid input type.`)}},3933:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseSqueezeAttributes=e.squeezeV13=e.squeeze=void 0;let r=n(2517);e.squeeze=(t$1,e$1,n$1)=>{i(e$1);let o$1=r.ShapeUtil.squeezeShape(e$1[0].dims,n$1);return[t$1.reshapeUnpacked(e$1[0],o$1)]},e.squeezeV13=(t$1,n$1)=>(o(n$1),(0,e.squeeze)(t$1,[n$1[0]],Array.from(n$1[1].integerData))),e.parseSqueezeAttributes=t$1=>t$1.attributes.getInts(`axes`);let i=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Squeeze requires 1 input.`);if(t$1[0].type===`string`)throw Error(`invalid input tensor types.`)},o=t$1=>{if(!t$1||t$1.length!==2)throw Error(`Squeeze requires 2 inputs.`);if(t$1[1].type!==`int32`)throw Error(`Invalid input type.`)}},6558:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.sum=void 0;let r=n(5060),i=n(2039);e.sum=(t$1,e$1)=>{a(e$1);let n$1={name:`Sum`,inputNames:e$1.map((t$2,e$2)=>`X${e$2}`),inputTypes:Array(e$1.length).fill(i.TextureType.unpacked)};return[t$1.run(Object.assign(Object.assign({},n$1),{get:()=>o(t$1,e$1,n$1)}),e$1)]};let o=(t$1,e$1,n$1)=>{let o$1=(0,r.getGlsl)(t$1.session.backend.glContext.version),a$1=e$1[0].dims.slice(),s=`\n void main() {\n vec4 result = ${e$1.map((t$2,e$2)=>`${o$1.texture2D}(X${e$2},TexCoords)`).join(` + `)};\n ${o$1.output} = result;\n }\n `;return Object.assign(Object.assign({},n$1),{output:{dims:a$1,type:e$1[0].type,textureType:i.TextureType.unpacked},hasMain:!0,shaderSource:s})},a=t$1=>{if(!t$1||t$1.length===0)throw Error(`Sum requires inputs.`);let e$1=t$1[0].dims.length;for(let n$1=1;n$1{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.tile=void 0;let r=n(782),i=n(2039);e.tile=(t$1,e$1)=>{a(e$1);let n$1={name:`Tile`,inputNames:[`A`],inputTypes:[i.TextureType.unpacked]};return[t$1.run(Object.assign(Object.assign({},n$1),{get:()=>o(t$1,e$1,n$1)}),e$1)]};let o=(t$1,e$1,n$1)=>{let r$1=e$1[0].dims.slice(),o$1=Array(r$1.length),a$1=[];for(let t$2=0;t$2{if(!t$1||t$1.length!==2)throw Error(`Tile requires 2 input.`);if(t$1[1].dims.length!==1)throw Error(`The second input shape must 1 dimension.`);if(t$1[1].dims[0]!==t$1[0].dims.length)throw Error(`Invalid input shape.`);if(r.NUMBER_TYPES.indexOf(t$1[0].type)===-1)throw Error(`Invalid input type.`);if(t$1[1].type!==`int32`&&t$1[1].type!==`int16`)throw Error(`Invalid repeat type.`)}},3738:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseTransposeAttributes=e.transpose=void 0;let r=n(246),i=n(2517),o=n(2039),a={name:`Transpose`,inputNames:[`A`],inputTypes:[o.TextureType.unpacked]};e.transpose=(t$1,e$1,n$1)=>(p$1(e$1),[t$1.run(Object.assign(Object.assign({},a),{cacheHint:n$1.cacheKey,get:()=>s(t$1,e$1[0],n$1.perm)}),e$1)]),e.parseTransposeAttributes=t$1=>(0,r.createAttributeWithCacheKey)({perm:t$1.attributes.getInts(`perm`,[])});let s=(t$1,e$1,n$1)=>{let r$1=e$1.dims;n$1=u(r$1,n$1);let i$1=c(r$1,n$1),s$1=r$1.length,p$2=`\n ${l(`perm`,n$1,s$1)}\n float process(int indices[${s$1}]) {\n int a[${s$1}];\n perm(a, indices);\n return _A(a);\n }`;return Object.assign(Object.assign({},a),{output:{dims:i$1,type:e$1.type,textureType:o.TextureType.unpacked},shaderSource:p$2})},u=(t$1,e$1)=>(e$1&&e$1.length!==t$1.length&&(e$1=[...t$1.keys()].reverse()),e$1),c=(t$1,e$1)=>(e$1=u(t$1,e$1),i.ShapeUtil.sortBasedOnPerm(t$1,e$1)),l=(t$1,e$1,n$1)=>{let r$1=[];r$1.push(`void ${t$1}(out int a[${n$1}], int src[${n$1}]) {`);for(let t$2=0;t$2{if(!t$1||t$1.length!==1)throw Error(`Transpose requires 1 input.`);if(t$1[0].type!==`float32`&&t$1[0].type!==`float64`)throw Error(`input should be float tensor`)}},8710:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.encodeAsUint8=void 0;let r=n(5060),i=n(2039);e.encodeAsUint8=(t$1,e$1)=>{let n$1=e$1.shape,o=(0,r.getGlsl)(t$1.session.backend.glContext.version),a=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float value = ${o.texture2D}(X,TexCoords).r;\n ${o.output} = encodeAsUint8(value);\n }`,s={name:`Uint8Encode`,inputTypes:[i.TextureType.unpacked],inputNames:[`X`],output:{dims:n$1,type:e$1.tensor.type,textureType:i.TextureType.downloadUint8AsFloat},shaderSource:a,hasMain:!0};return t$1.executeProgram(s,[e$1.tensor])}},4909:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.tanh=e.tan=e.sqrt=e.sin=e.sigmoid=e.relu=e.not=e.neg=e.log=e.parseLeakyReluAttributes=e.leakyRelu=e.identity=e.floor=e.exp=e.parseEluAttributes=e.elu=e.cos=e.ceil=e.clipV11=e.parseClipAttributes=e.clip=e.atan=e.asin=e.acos=e.abs=e.glslTanh=e.glslTan=e.glslSqrt=e.glslSigmoid=e.glslRelu=e.glslSin=e.glslNot=e.glslNeg=e.glslLog=e.glslLeakyRelu=e.glslIdentity=e.glslClip=e.glslFloor=e.glslExp=e.glslElu=e.glslCos=e.glslCeil=e.glslAtan=e.glslAsin=e.glslAcos=e.glslAbs=void 0;let r=n(246),i=n(2517),o=n(8520),a=n(5060),s=n(2039);function u(){return P(`abs`)}function c(){return P(`acos`)}function l(){return P(`asin`)}function p$1(){return P(`atan`)}function f(){return P(`ceil`)}function d(){return P(`cos`)}function h(t$1){let e$1=`elu`;return{body:`\n const float alpha = float(${t$1});\n\n float ${e$1}_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ${e$1}_(vec4 v) {\n return vec4(${e$1}_(v.x), ${e$1}_(v.y), ${e$1}_(v.z), ${e$1}_(v.w));\n }\n `,name:e$1,type:o.FunctionType.ValueBased}}function g(){return P(`exp`)}function b(){return P(`floor`)}function m(t$1,e$1){let n$1=`clip`;return{body:`\n const float min = float(${t$1});\n const float max = float(${e$1});\n\n float ${n$1}_(float a) {\n return clamp(a, min, max);\n }\n vec4 ${n$1}_(vec4 v) {\n return clamp(v, min, max);\n }\n `,name:n$1,type:o.FunctionType.ValueBased}}function y(){let t$1=`indentity`;return{body:`\n float ${t$1}_(float a) {\n return a;\n }\n vec4 ${t$1}_(vec4 v) {\n return v;\n }\n `,name:t$1,type:o.FunctionType.ValueBased}}function _(t$1){let e$1=`leakyRelu`;return{body:`\n const float alpha = float(${t$1});\n\n float ${e$1}_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ${e$1}_(vec4 v) {\n return vec4(${e$1}_(v.x), ${e$1}_(v.y), ${e$1}_(v.z), ${e$1}_(v.w));\n }\n `,name:e$1,type:o.FunctionType.ValueBased}}function v(){return P(`log`)}function w(){let t$1=`neg`;return{body:`\n float ${t$1}_(float a) {\n return -a;\n }\n vec4 ${t$1}_(vec4 v) {\n return -v;\n }\n `,name:t$1,type:o.FunctionType.ValueBased}}function x(){let t$1=`not`;return{body:`\n float ${t$1}_(float a) {\n return float( ! bool(a) );\n }\n bool ${t$1}_(bool a) {\n return !a;\n }\n vec4 ${t$1}_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ${t$1}_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n `,name:t$1,type:o.FunctionType.ValueBased}}function T(){return P(`sin`)}function S(){let t$1=`relu`;return{body:`\n float ${t$1}_(float a) {\n return max( a, 0.0 );\n }\n vec4 ${t$1}_(vec4 v) {\n return max( v, 0.0 );\n }\n `,name:t$1,type:o.FunctionType.ValueBased}}function O(){let t$1=`sigmoid`;return{body:`\n float ${t$1}_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ${t$1}_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n `,name:t$1,type:o.FunctionType.ValueBased}}function A(){return P(`sqrt`)}function E(){return P(`tan`)}function I(){let t$1=`tanh`;return{body:`\n float ${t$1}_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ${t$1}_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n `,name:t$1,type:o.FunctionType.ValueBased}}function P(t$1){return{body:`\n float ${t$1}_(float a) {\n return ${t$1}(a);\n }\n vec4 ${t$1}_(vec4 v) {\n return ${t$1}(v);\n }\n `,name:t$1,type:o.FunctionType.ValueBased}}e.glslAbs=u,e.glslAcos=c,e.glslAsin=l,e.glslAtan=p$1,e.glslCeil=f,e.glslCos=d,e.glslElu=h,e.glslExp=g,e.glslFloor=b,e.glslClip=m,e.glslIdentity=y,e.glslLeakyRelu=_,e.glslLog=v,e.glslNeg=w,e.glslNot=x,e.glslSin=T,e.glslRelu=S,e.glslSigmoid=O,e.glslSqrt=A,e.glslTan=E,e.glslTanh=I;let D=(t$1,e$1,n$1,r$1)=>{let i$1=t$1.session.pack?s.TextureType.packed:s.TextureType.unpacked,o$1={name:n$1.name,inputTypes:[i$1],inputNames:[`A`],cacheHint:r$1};return Object.assign(Object.assign({},o$1),{get:()=>((t$2,e$2,n$2,r$2)=>{let i$2=t$2.session.pack?s.TextureType.packed:s.TextureType.unpacked,o$2=(0,a.getGlsl)(t$2.session.backend.glContext.version);return Object.assign(Object.assign({},e$2),{output:{dims:n$2.dims,type:n$2.type,textureType:i$2},shaderSource:`\n ${r$2.body}\n void main() {\n vec4 v = ${o$2.texture2D}(A, TexCoords);\n v = ${r$2.name}_(v);\n ${o$2.output} = v;\n }\n `,hasMain:!0})})(t$1,o$1,e$1,n$1)})};e.abs=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],u()),e$1)],e.acos=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],c()),e$1)],e.asin=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],l()),e$1)],e.atan=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],p$1()),e$1)],e.clip=(t$1,e$1,n$1)=>[t$1.run(D(t$1,e$1[0],m(n$1.min,n$1.max),n$1.cacheKey),e$1)],e.parseClipAttributes=t$1=>(0,r.createAttributeWithCacheKey)({min:t$1.attributes.getFloat(`min`,i.MIN_CLIP),max:t$1.attributes.getFloat(`max`,i.MAX_CLIP)}),e.clipV11=(t$1,n$1)=>{let r$1=$(t$1,n$1);return(0,e.clip)(t$1,[n$1[0]],r$1)};let $=(t$1,e$1)=>{if(e$1.length>=3&&(!t$1.session.isInitializer(e$1[1].dataId)||!t$1.session.isInitializer(e$1[2].dataId)))throw Error(`dynamic clip attributes are not allowed`);let n$1=e$1.length>=3?e$1[1].numberData[0]:i.MIN_CLIP,o$1=e$1.length>=3?e$1[2].numberData[0]:i.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n$1,max:o$1})};e.ceil=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],f()),e$1)],e.cos=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],d()),e$1)],e.elu=(t$1,e$1,n$1)=>[t$1.run(D(t$1,e$1[0],h(n$1.alpha),n$1.cacheKey),e$1)],e.parseEluAttributes=t$1=>(0,r.createAttributeWithCacheKey)({alpha:t$1.attributes.getFloat(`alpha`,1)}),e.exp=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],g()),e$1)],e.floor=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],b()),e$1)],e.identity=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],y()),e$1)],e.leakyRelu=(t$1,e$1,n$1)=>[t$1.run(D(t$1,e$1[0],_(n$1.alpha),n$1.cacheKey),e$1)],e.parseLeakyReluAttributes=t$1=>(0,r.createAttributeWithCacheKey)({alpha:t$1.attributes.getFloat(`alpha`,.01)}),e.log=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],v()),e$1)],e.neg=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],w()),e$1)],e.not=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],x()),e$1)],e.relu=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],S()),e$1)],e.sigmoid=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],O()),e$1)],e.sin=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],T()),e$1)],e.sqrt=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],A()),e$1)],e.tan=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],E()),e$1)],e.tanh=(t$1,e$1)=>[t$1.run(D(t$1,e$1[0],I()),e$1)]},5611:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createUnpackProgramInfoLoader=e.createUnpackProgramInfo=void 0;let r=n(5060),i=n(2039),o=n(9390),a=n(2827),s={name:`unpack`,inputNames:[`A`],inputTypes:[i.TextureType.packed]};e.createUnpackProgramInfo=(t$1,e$1)=>{let n$1=e$1.dims.length,u=(0,a.getChannels)(`rc`,n$1),c=u.slice(-2),l=(0,o.getCoordsDataType)(n$1),p$1=(0,a.unpackFromChannel)(),f=e$1.dims.length===0?``:function(t$2,e$2){if(t$2===1)return`rc`;let n$2=``;for(let r$1=0;r$1Object.assign(Object.assign({},s),{get:()=>(0,e.createUnpackProgramInfo)(t$1,n$1)})},8428:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseUnsqueezeAttributes=e.unsqueezeV13=e.unsqueeze=void 0;let r=n(2517);e.unsqueeze=(t$1,e$1,n$1)=>{i(e$1);let o$1=r.ShapeUtil.unsqueezeShape(e$1[0].dims,n$1);return[t$1.reshapeUnpacked(e$1[0],o$1)]},e.unsqueezeV13=(t$1,n$1)=>(o(n$1),(0,e.unsqueeze)(t$1,[n$1[0]],Array.from(n$1[1].integerData))),e.parseUnsqueezeAttributes=t$1=>t$1.attributes.getInts(`axes`);let i=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Unsqueeze requires 1 input.`);if(t$1[0].type===`string`)throw Error(`invalid input tensor types.`)},o=t$1=>{if(!t$1||t$1.length!==2)throw Error(`Unsqueeze requires 2 inputs.`);if(t$1[1].type!==`int32`)throw Error(`Invalid input type.`)}},9793:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.scalesValidation=e.validateInputs=e.parseUpsampleAttributes=e.parseUpsampleAttributesV9=e.parseUpsampleAttributesV7=e.upsample=void 0;let r=n(246),i=n(5060),o=n(2039),a={name:`Upsample`,inputNames:[`X`],inputTypes:[o.TextureType.unpacked]};e.upsample=(t$1,n$1,r$1)=>((0,e.validateInputs)(n$1,r$1),[t$1.run(Object.assign(Object.assign({},a),{cacheHint:r$1.cacheKey,get:()=>s(t$1,n$1,r$1)}),n$1)]),e.parseUpsampleAttributesV7=t$1=>(0,e.parseUpsampleAttributes)(t$1,7),e.parseUpsampleAttributesV9=t$1=>(0,e.parseUpsampleAttributes)(t$1,9),e.parseUpsampleAttributes=(t$1,n$1)=>{let i$1=n$1>=10,o$1=t$1.attributes.getString(`mode`,`nearest`);if(o$1!==`nearest`&&o$1!==`linear`&&(n$1<11||o$1!==`cubic`))throw Error(`unrecognized mode: ${o$1}`);let a$1=[];n$1<9&&(a$1=t$1.attributes.getFloats(`scales`),(0,e.scalesValidation)(a$1,o$1,i$1));let s$1=t$1.attributes.getFloat(`extrapolation_value`,0),u=n$1>10?t$1.attributes.getString(`coordinate_transformation_mode`,`half_pixel`):`asymmetric`;if([`asymmetric`,`pytorch_half_pixel`,`tf_half_pixel_for_nn`,`align_corners`,`tf_crop_and_resize`,`half_pixel`].indexOf(u)===-1)throw Error(`coordinate_transform_mode '${u}' is not supported`);let c=u===`tf_crop_and_resize`,l=c,p$1=o$1===`nearest`&&n$1>=11?t$1.attributes.getString(`nearest_mode`,`round_prefer_floor`):``;if([`round_prefer_floor`,`round_prefer_ceil`,`floor`,`ceil`,``].indexOf(p$1)===-1)throw Error(`nearest_mode '${p$1}' is not supported`);let f=t$1.attributes.getFloat(`cubic_coeff_a`,-.75),d=t$1.attributes.getInt(`exclude_outside`,0)!==0;if(d&&o$1!==`cubic`)throw Error(`exclude_outside can be set to 1 only when mode is CUBIC.`);let h=n$1<11||o$1===`nearest`&&u===`asymmetric`&&p$1===`floor`,g=0,b=0,m=0;return n$1>10?t$1.inputs.length>2?(g=1,b=2,m=3):(b=1,m=2):n$1===9&&(b=1),(0,r.createAttributeWithCacheKey)({opset:n$1,isResize:i$1,mode:o$1,scales:a$1,extrapolationValue:s$1,coordinateTransformMode:u,useExtrapolation:l,needRoiInput:c,nearestMode:p$1,cubicCoefficientA:f,excludeOutside:d,useNearest2xOptimization:h,roiInputIdx:g,scalesInputIdx:b,sizesInputIdx:m})};let s=(t$1,e$1,n$1)=>{let r$1=(0,i.getGlsl)(t$1.session.backend.glContext.version),[s$1,u]=t$1.calculateTextureWidthAndHeight(e$1[0].dims,o.TextureType.unpacked),c=e$1[0].dims.map((t$2,e$2)=>Math.floor(t$2*n$1.scales[e$2])),[l,p$1]=t$1.calculateTextureWidthAndHeight(c,o.TextureType.unpacked),f=c.length,d=Array(f),h=Array(f),g=`\n int output_pitches[${f}];\n int input_pitches[${f}];\n `;for(let t$2=f-1;t$2>=0;t$2--)d[t$2]=t$2===f-1?1:d[t$2+1]*c[t$2+1],h[t$2]=t$2===f-1?1:h[t$2+1]*e$1[0].dims[t$2+1],g+=`\n output_pitches[${t$2}] = ${d[t$2]};\n input_pitches[${t$2}] = ${h[t$2]};\n `;let b=`\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ${s$1}, ${u});\n float value = getColorAsFloat(${r$1.texture2D}(X, coords));\n return value;\n }\n `,m=n$1.mode===`nearest`?`\n ${b}\n float process(int indices[${f}]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${l}, ${p$1});\n\n ${g}\n\n int d, m;\n for (int dim = 0; dim < ${f}; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }`:f===4?`\n ${b}\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${l}, ${p$1});\n\n ${g}\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (${e$1[0].dims[2]} - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }`:`\n ${b}\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${l}, ${p$1});\n\n ${g}\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (${e$1[0].dims[0]} - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }`;return Object.assign(Object.assign({},a),{output:{dims:c,type:e$1[0].type,textureType:o.TextureType.unpacked},shaderSource:m,variables:[{name:`scales`,type:`int`,arrayLength:n$1.scales.length,data:n$1.scales.map(t$2=>Math.ceil(t$2))}]})};e.validateInputs=(t$1,e$1)=>{if(!t$1||e$1.opset<9&&t$1.length!==1||e$1.opset>=9&&e$1.opset<11&&t$1.length!==2||e$1.opset>=11&&t$1.length<2)throw Error(`invalid inputs.`);if(e$1.scales.length>0&&t$1[0].dims.length!==e$1.scales.length)throw Error(`Invalid input shape.`);if(t$1[0].type===`string`)throw Error(`Invalid input tensor types.`)},e.scalesValidation=(t$1,e$1,n$1)=>{if(n$1){for(let e$2 of t$1)if(e$2<=0)throw Error(`Scale value should be greater than 0.`)}else for(let e$2 of t$1)if(e$2<1)throw Error(`Scale value should be greater than or equal to 1.`);if(!(e$1!==`linear`&&e$1!==`cubic`||t$1.length===2||t$1.length===4&&t$1[0]===1&&t$1[1]===1))throw Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n$1?`Resize`:`Upsample`} opeartor.`)}},1958:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.ProgramManager=void 0;let r=n(1670),i=n(6231),o=n(8879),a=n(5060);e.ProgramManager=class{constructor(t$1,e$1,n$1){this.profiler=t$1,this.glContext=e$1,this.textureLayoutStrategy=n$1,this.repo=new Map,this.attributesBound=!1}getArtifact(t$1){return this.repo.get(t$1)}setArtifact(t$1,e$1){this.repo.set(t$1,e$1)}run(t$1,e$1,n$1){var r$1;this.profiler.event(`op`,`ProgramManager.run ${(r$1=t$1.programInfo.name)??`unknown kernel`}`,()=>{var r$2;let o$1=this.glContext.gl,a$1=t$1.program;o$1.useProgram(a$1);try{this.bindOutput(n$1),this.attributesBound||this.bindAttributes(t$1.attribLocations),this.bindUniforms(t$1.uniformLocations,(r$2=t$1.programInfo.variables)??[],e$1)}catch(e$2){throw i.Logger.error(`ProgramManager`,t$1.programInfo.shaderSource),e$2}this.profiler.event(`backend`,`GlContext.draw()`,()=>{this.glContext.draw()})},this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach(t$1=>this.glContext.deleteProgram(t$1.program))}build(t$1,e$1,n$1){return this.profiler.event(`backend`,`ProgramManager.build`,()=>{let r$1=new o.GlslPreprocessor(this.glContext,t$1,e$1,n$1),i$1=r$1.preprocess(),a$1=this.compile(i$1);return{programInfo:t$1,program:a$1,uniformLocations:this.getUniformLocations(a$1,r$1.context.programInfo.inputNames,r$1.context.programInfo.variables),attribLocations:this.getAttribLocations(a$1)}})}compile(t$1){if(!this.vertexShader){i.Logger.verbose(`ProrgramManager`,`Compiling and caching Vertex shader for the first time`);let t$2=(0,a.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(t$2,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&i.Logger.verbose(`ProrgramManager`,`FragShader:\n${t$1}\n`);let e$1=this.glContext.compileShader(t$1,this.glContext.gl.FRAGMENT_SHADER),n$1=this.glContext.createProgram(this.vertexShader,e$1);return this.glContext.deleteShader(e$1),n$1}bindOutput(t$1){let e$1=t$1.width,n$1=t$1.height;i.Logger.verbose(`ProrgramManager`,`Binding output texture to Framebuffer: w/h=${e$1}/${n$1}, shape=${t$1.shape}, type=${t$1.tensor.type}`),this.glContext.attachFramebuffer(t$1.texture,e$1,n$1)}bindAttributes(t$1){let e$1=t$1.position,n$1=t$1.textureCoord;this.glContext.setVertexAttributes(e$1,n$1),this.attributesBound=!0}bindUniforms(t$1,e$1,n$1){var r$1;let i$1=this.glContext.gl,o$1=0;for(let{name:a$1,type:s,location:u,arrayLength:c}of t$1){let t$2=(r$1=e$1.find(t$3=>t$3.name===a$1))?.data;if(s!==`sampler2D`&&!t$2)throw Error(`variable '${a$1}' does not have data defined in program info`);switch(s){case`sampler2D`:this.bindTexture(n$1[o$1],u,o$1),o$1++;break;case`float`:c?i$1.uniform1fv(u,t$2):i$1.uniform1f(u,t$2);break;case`int`:c?i$1.uniform1iv(u,t$2):i$1.uniform1i(u,t$2);break;default:throw Error(`Uniform not implemented: ${s}`)}}}bindTexture(t$1,e$1,n$1){this.glContext.bindTextureToUniform(t$1.texture,n$1,e$1)}getAttribLocations(t$1){return{position:this.getAttribLocation(t$1,`position`),textureCoord:this.getAttribLocation(t$1,`textureCoord`)}}getUniformLocations(t$1,e$1,n$1){let r$1=[];if(e$1)for(let n$2 of e$1)r$1.push({name:n$2,type:`sampler2D`,location:this.getUniformLocation(t$1,n$2)});if(n$1)for(let e$2 of n$1)r$1.push(Object.assign(Object.assign({},e$2),{location:this.getUniformLocation(t$1,e$2.name)}));return r$1}getUniformLocation(t$1,e$1){let n$1=this.glContext.gl.getUniformLocation(t$1,e$1);if(n$1===null)throw Error(`Uniform ${e$1} not found.`);return n$1}getAttribLocation(t$1,e$1){return this.glContext.gl.getAttribLocation(t$1,e$1)}}},6416:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.WebGLSessionHandler=void 0;let r=n(6231),i=n(1047),o=n(8316),a=n(1640),s=n(1958),u=n(7859),c=n(5702);e.WebGLSessionHandler=class{constructor(t$1,e$1){this.backend=t$1,this.context=e$1,this.layoutStrategy=new u.PreferLogicalStrategy(t$1.glContext.maxTextureSize),this.programManager=new s.ProgramManager(this.context.profiler,t$1.glContext,this.layoutStrategy),this.textureManager=new c.TextureManager(t$1.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:t$1.textureCacheMode===`full`}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=t$1.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new o.WebGLInferenceHandler(this)}onGraphInitialized(t$1){let e$1=t$1.getValues().filter(t$2=>t$2.from===-1&&t$2.tensor).map(t$2=>t$2.tensor.dataId);this.initializers=new Set(e$1)}isInitializer(t$1){return!!this.initializers&&this.initializers.has(t$1)}addInitializer(t$1){this.initializers.add(t$1)}getTextureData(t$1,e$1){return e$1?this.packedTextureDataCache.get(t$1):this.unpackedTextureDataCache.get(t$1)}setTextureData(t$1,e$1,n$1=!1){r.Logger.verbose(`WebGLSessionHandler`,`Storing Texture data in cache`),n$1?this.packedTextureDataCache.set(t$1,e$1):this.unpackedTextureDataCache.set(t$1,e$1)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(t$1=>this.textureManager.releaseTexture(t$1,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(t$1=>this.textureManager.releaseTexture(t$1,!0)),this.unpackedTextureDataCache=new Map}resolve(t$1,e$1,n$1){let r$1=(0,i.resolveOperator)(t$1,e$1,a.WEBGL_OP_RESOLVE_RULES);return{impl:r$1.opImpl,context:r$1.opInit?r$1.opInit(t$1,n$1):t$1}}}},7769:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.Uint8DataEncoder=e.RGBAFloatDataEncoder=e.RedFloat32DataEncoder=void 0;let r=n(6231);e.RedFloat32DataEncoder=class{constructor(t$1,e$1=1){if(e$1===1)this.internalFormat=t$1.R32F,this.format=t$1.RED,this.textureType=t$1.FLOAT,this.channelSize=e$1;else{if(e$1!==4)throw Error(`Invalid number of channels: ${e$1}`);this.internalFormat=t$1.RGBA32F,this.format=t$1.RGBA,this.textureType=t$1.FLOAT,this.channelSize=e$1}}encode(t$1,e$1){let n$1,i;return t$1.constructor!==Float32Array&&(r.Logger.warning(`Encoder`,`data was not of type Float32; creating new Float32Array`),i=new Float32Array(t$1)),e$1*this.channelSize>t$1.length?(r.Logger.warning(`Encoder`,`Source data too small. Allocating larger array`),i=t$1,n$1=this.allocate(e$1*this.channelSize),i.forEach((t$2,e$2)=>n$1[e$2]=t$2)):(i=t$1,n$1=i),n$1}allocate(t$1){return new Float32Array(4*t$1)}decode(t$1,e$1){return this.channelSize===1?t$1.filter((t$2,e$2)=>e$2%4==0).subarray(0,e$1):t$1.subarray(0,e$1)}},e.RGBAFloatDataEncoder=class{constructor(t$1,e$1=1,n$1){if(e$1!==1&&e$1!==4)throw Error(`Invalid number of channels: ${e$1}`);this.internalFormat=t$1.RGBA,this.format=t$1.RGBA,this.channelSize=e$1,this.textureType=n$1||t$1.FLOAT}encode(t$1,e$1){let n$1=t$1;return this.channelSize===1&&(r.Logger.verbose(`Encoder`,`Exploding into a larger array`),n$1=this.allocate(e$1),t$1.forEach((t$2,e$2)=>n$1[4*e$2]=t$2)),n$1}allocate(t$1){return new Float32Array(4*t$1)}decode(t$1,e$1){return this.channelSize===1?t$1.filter((t$2,e$2)=>e$2%4==0).subarray(0,e$1):t$1.subarray(0,e$1)}},e.Uint8DataEncoder=class{constructor(t$1,e$1=1){if(this.channelSize=4,e$1===1)this.internalFormat=t$1.ALPHA,this.format=t$1.ALPHA,this.textureType=t$1.UNSIGNED_BYTE,this.channelSize=e$1;else{if(e$1!==4)throw Error(`Invalid number of channels: ${e$1}`);this.internalFormat=t$1.RGBA,this.format=t$1.RGBA,this.textureType=t$1.UNSIGNED_BYTE,this.channelSize=e$1}}encode(t$1,e$1){return new Uint8Array(t$1.buffer,t$1.byteOffset,t$1.byteLength)}allocate(t$1){return new Uint8Array(t$1*this.channelSize)}decode(t$1,e$1){if(t$1 instanceof Uint8Array)return t$1.subarray(0,e$1);throw Error(`Invalid array type: ${t$1.constructor}`)}}},7859:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.getBatchDim=e.sizeToSquarishShape=e.getRowsCols=e.sizeFromShape=e.isInt=e.parseAxisParam=e.squeezeShape=e.PreferLogicalStrategy=e.AlwaysKeepOriginalSizeStrategy=void 0;let r=n(6231),i=n(2517);function o(t$1,e$1){let n$1=[],r$1=[],i$1=e$1!=null&&Array.isArray(e$1)&&e$1.length===0,o$1=e$1==null||i$1?null:a(e$1,t$1).sort(),s$1=0;for(let e$2=0;e$2e$2)&&t$1[e$2]===1&&(n$1.push(t$1[e$2]),r$1.push(e$2)),o$1[s$1]<=e$2&&s$1++}t$1[e$2]!==1&&(n$1.push(t$1[e$2]),r$1.push(e$2))}return{newShape:n$1,keptDims:r$1}}function a(t$1,e$1){let n$1=e$1.length;return t$1=t$1==null?e$1.map((t$2,e$2)=>e$2):[].concat(t$1),(0,i.assert)(t$1.every(t$2=>t$2>=-n$1&&t$2`All values in axis param must be in range [-${n$1}, ${n$1}) but got axis ${t$1}`),(0,i.assert)(t$1.every(s),()=>`All values in axis param must be integers but got axis ${t$1}`),t$1.map(t$2=>t$2<0?n$1+t$2:t$2)}function s(t$1){return t$1%1==0}function u(t$1){if(t$1.length===0)return 1;let e$1=t$1[0];for(let n$1=1;n$1=t$1.length?1:t$1.slice(e$1.breakAxis).reduce((t$2,e$2)=>t$2*e$2),o$2=e$1.breakAxis<=0?1:t$1.slice(0,e$1.breakAxis).reduce((t$2,e$2)=>t$2*e$2);if(!(i$2>n$1||o$2>n$1))return[i$2,o$2];r.Logger.verbose(`TextureLayout`,`Given width/height preferences were unattainable: shape:${t$1}, breakAxis:${e$1.breakAxis}`)}let i$1=t$1.reduce((t$2,e$2)=>t$2*e$2),o$1=Math.floor(Math.sqrt(i$1));for(;o$1=n$1||i$1%o$1!=0)throw Error(`The given dimensions are outside this GPU's boundaries: ${t$1}`);return[o$1,i$1/o$1]}},e.PreferLogicalStrategy=class{constructor(t$1){this.maxTextureSize=t$1}computeTextureWH(t$1,e$1){let n$1=this.computeTexture(t$1,e$1);return e$1&&e$1.isPacked&&(n$1[0]/=2,n$1[1]/=2),e$1&&e$1.reverseWH?[n$1[1],n$1[0]]:n$1}computeTexture(t$1,e$1){let n$1=e$1&&e$1.isPacked;if(t$1.length===0)return n$1?[2,2]:[1,1];let i$1=this.maxTextureSize;if(e$1&&e$1.breakAxis!==void 0){let n$2=e$1.breakAxis>=t$1.length?1:t$1.slice(e$1.breakAxis).reduce((t$2,e$2)=>t$2*e$2),o$1=e$1.breakAxis<=0?1:t$1.slice(0,e$1.breakAxis).reduce((t$2,e$2)=>t$2*e$2);if(!(n$2>i$1||o$1>i$1))return[n$2,o$1];r.Logger.verbose(`TextureLayout`,`Given width/height preferences were unattainable: shape:${t$1}, breakAxis:${e$1.breakAxis}`)}let a$1=t$1.slice(0);if(n$1&&(i$1*=2,a$1=a$1.map((t$2,e$2)=>e$2>=a$1.length-2?a$1[e$2]%2==0?a$1[e$2]:a$1[e$2]+1:a$1[e$2]),a$1.length===1&&(a$1=[2,a$1[0]])),a$1.length!==2){let t$2=o(a$1);a$1=t$2.newShape}let s$1=u(a$1);return a$1.length<=1&&s$1<=i$1?[1,s$1]:a$1.length===2&&a$1[0]<=i$1&&a$1[1]<=i$1?a$1:a$1.length===3&&a$1[0]*a$1[1]<=i$1&&a$1[2]<=i$1?[a$1[0]*a$1[1],a$1[2]]:a$1.length===3&&a$1[0]<=i$1&&a$1[1]*a$1[2]<=i$1?[a$1[0],a$1[1]*a$1[2]]:a$1.length===4&&a$1[0]*a$1[1]*a$1[2]<=i$1&&a$1[3]<=i$1?[a$1[0]*a$1[1]*a$1[2],a$1[3]]:a$1.length===4&&a$1[0]<=i$1&&a$1[1]*a$1[2]*a$1[3]<=i$1?[a$1[0],a$1[1]*a$1[2]*a$1[3]]:n$1?c(s$1/4).map(t$2=>2*t$2):c(s$1)}},e.squeezeShape=o,e.parseAxisParam=a,e.isInt=s,e.sizeFromShape=u,e.getRowsCols=function(t$1){if(t$1.length===0)throw Error(`Cannot get rows and columns of an empty shape array.`);return[t$1.length>1?t$1[t$1.length-2]:1,t$1[t$1.length-1]]},e.sizeToSquarishShape=c,e.getBatchDim=function(t$1,e$1=2){return u(t$1.slice(0,t$1.length-e$1))}},4057:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createTextureLayoutFromShape=e.calculateTextureWidthAndHeight=e.createTextureLayoutFromTextureType=void 0;let r=n(2517),i=n(2039);e.createTextureLayoutFromTextureType=(t$1,n$1,r$1)=>{let o=r$1===i.TextureType.unpacked||r$1===i.TextureType.unpackedReversed?1:4,a=r$1===i.TextureType.packed,s=r$1===i.TextureType.unpackedReversed||r$1===i.TextureType.packed,u=r$1===i.TextureType.packedLastDimension?n$1.length-1:void 0,c=r$1===i.TextureType.packedLastDimension?n$1.map((t$2,e$1)=>e$1===n$1.length-1?4*t$2:t$2):void 0;return(0,e.createTextureLayoutFromShape)(t$1,n$1,o,c,{isPacked:a,reverseWH:s,breakAxis:u})},e.calculateTextureWidthAndHeight=(t$1,n$1,r$1)=>{let i$1=(0,e.createTextureLayoutFromTextureType)(t$1,n$1,r$1);return[i$1.width,i$1.height]},e.createTextureLayoutFromShape=(t$1,e$1,n$1=1,i$1,o)=>{let a=!(!o||!o.isPacked),[s,u]=t$1.computeTextureWH(a&&i$1||e$1,o),c=e$1.length,l=e$1.slice(0);if(c===0&&(l=[1]),n$1===1)i$1=e$1;else if(a){if(n$1!==4)throw Error(`a packed texture must be 4-channel`);i$1=e$1,c>0&&(l[c-1]=Math.ceil(l[c-1]/2)),c>1&&(l[c-2]=Math.ceil(l[c-2]/2))}else if(!i$1)throw Error(`Unpacked shape is needed when using channels > 1`);return{width:s,height:u,channels:n$1,isPacked:a,shape:l,strides:r.ShapeUtil.computeStrides(l),unpackedShape:i$1,reversedWH:o&&o.reverseWH}}},5702:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.TextureManager=void 0;let r=n(6231);e.TextureManager=class{constructor(t$1,e$1,n$1,r$1){this.glContext=t$1,this.layoutStrategy=e$1,this.profiler=n$1,this.config=r$1,this.pendingRead=new Map,r$1.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(t$1,e$1,n$1,i){let o=this.toEncoderType(t$1),a=this.glContext.getEncoder(o,e$1.channels||1,i);if(e$1.isPacked&&i===1)throw Error(`not implemented`);let s=e$1.width,u=e$1.height,c,l;if(this.config.reuseTextures){c=`${s}x${u}_${a.format}_${a.internalFormat}_${a.textureType}`,l=this.inUseTextures.get(c),l||(l=[],this.inUseTextures.set(c,l));let e$2=this.idleTextures.get(c);if(e$2&&e$2.length>0){let r$1=e$2.pop();return l.push(r$1),i===1&&this.glContext.updateTexture(r$1,s,u,a,this.toTextureData(t$1,n$1)),r$1}}r.Logger.verbose(`TextureManager`,`Creating new texture of size ${e$1.width}x${e$1.height}`);let p$1=this.glContext.allocateTexture(s,u,a,this.toTextureData(t$1,n$1));return this.config.reuseTextures&&(l.push(p$1),this.textureLookup.set(p$1,c)),p$1}readTexture(t$1,e$1,n$1){return n$1||=1,this.profiler.event(`backend`,`TextureManager.readTexture`,()=>{let r$1=t$1.shape.reduce((t$2,e$2)=>t$2*e$2)*n$1,i=this.glContext.readTexture(t$1.texture,t$1.width,t$1.height,r$1,this.toEncoderType(e$1),n$1);return this.toTensorData(e$1,i)})}async readTextureAsync(t$1,e$1,n$1){let r$1=t$1.tensor.dataId;if(n$1||=1,this.pendingRead.has(r$1)){let t$2=this.pendingRead.get(r$1);return new Promise(e$2=>t$2?.push(e$2))}return this.profiler.event(`backend`,`TextureManager.readTextureAsync`,async()=>{this.pendingRead.set(r$1,[]);let i=t$1.shape.reduce((t$2,e$2)=>t$2*e$2)*n$1;await this.glContext.createAndWaitForFence();let o=this.glContext.readTexture(t$1.texture,t$1.width,t$1.height,i,this.toEncoderType(e$1),n$1),a=this.toTensorData(e$1,o),s=this.pendingRead.get(r$1);return this.pendingRead.delete(r$1),s?.forEach(t$2=>t$2(a)),a})}readUint8TextureAsFloat(t$1){return this.profiler.event(`backend`,`TextureManager.readUint8TextureAsFloat`,()=>{let e$1=t$1.shape.reduce((t$2,e$2)=>t$2*e$2),n$1=this.glContext.readTexture(t$1.texture,t$1.width,t$1.height,4*e$1,`byte`,4);return new Float32Array(n$1.buffer,n$1.byteOffset,e$1)})}releaseTexture(t$1,e$1){let n$1;if(this.config.reuseTextures&&(n$1=this.textureLookup.get(t$1.texture),n$1)){e$1&&this.textureLookup.delete(n$1);let r$1=this.inUseTextures.get(n$1);if(r$1){let e$2=r$1.indexOf(t$1.texture);if(e$2!==-1){r$1.splice(e$2,1);let i=this.idleTextures.get(n$1);i||(i=[],this.idleTextures.set(n$1,i)),i.push(t$1.texture)}}}n$1&&!e$1||(r.Logger.verbose(`TextureManager`,`Deleting texture of size ${t$1.width}x${t$1.height}`),this.glContext.deleteTexture(t$1.texture))}toTensorData(t$1,e$1){switch(t$1){case`int16`:return e$1 instanceof Int16Array?e$1:Int16Array.from(e$1);case`int32`:return e$1 instanceof Int32Array?e$1:Int32Array.from(e$1);case`int8`:return e$1 instanceof Int8Array?e$1:Int8Array.from(e$1);case`uint16`:return e$1 instanceof Uint16Array?e$1:Uint16Array.from(e$1);case`uint32`:return e$1 instanceof Uint32Array?e$1:Uint32Array.from(e$1);case`uint8`:case`bool`:return e$1 instanceof Uint8Array?e$1:Uint8Array.from(e$1);case`float32`:return e$1 instanceof Float32Array?e$1:Float32Array.from(e$1);case`float64`:return e$1 instanceof Float64Array?e$1:Float64Array.from(e$1);default:throw Error(`TensorData type ${t$1} is not supported`)}}toTextureData(t$1,e$1){if(e$1)return e$1 instanceof Float32Array?e$1:new Float32Array(e$1)}toEncoderType(t$1){return`float`}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(t,e)=>{"use strict";var n;Object.defineProperty(e,`__esModule`,{value:!0}),e.TextureType=void 0,(n=e.TextureType||={})[n.unpacked=0]=`unpacked`,n[n.unpackedReversed=1]=`unpackedReversed`,n[n.packed=2]=`packed`,n[n.downloadUint8AsFloat=3]=`downloadUint8AsFloat`,n[n.packedLastDimension=4]=`packedLastDimension`},9390:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.getGlChannels=e.getCoordsDataType=e.getSqueezedParams=e.squeezeInputShape=e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=e.generateShaderFuncNameFromInputSamplerName=e.repeatedTry=e.getPackedShape=void 0;let r=n(2517);e.getPackedShape=function(t$1){let e$1=t$1.length;return t$1.slice(0,e$1-1).concat(t$1[e$1-1]/4)},e.repeatedTry=async function(t$1,e$1=t$2=>0,n$1){return new Promise((r$1,i)=>{let o=0,a=()=>{if(t$1())return void r$1();o++;let s=e$1(o);n$1!=null&&o>=n$1?i():setTimeout(a,s)};a()})},e.generateShaderFuncNameFromInputSamplerName=function(t$1){return(0,r.assert)(t$1!==void 0&&t$1.length!==0,()=>`empty string found for sampler name`),`get`+t$1.charAt(0).toUpperCase()+t$1.slice(1)},e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(t$1){return(0,r.assert)(t$1!==void 0&&t$1.length!==0,()=>`empty string found for sampler name`),`get`+t$1.charAt(0).toUpperCase()+t$1.slice(1)+`AtOutCoords`},e.squeezeInputShape=function(t$1,e$1){let n$1=JSON.parse(JSON.stringify(t$1));return n$1=e$1,n$1},e.getSqueezedParams=function(t$1,e$1){return e$1.map(e$2=>t$1[e$2]).join(`, `)},e.getCoordsDataType=function(t$1){if(t$1<=1)return`int`;if(t$1===2)return`ivec2`;if(t$1===3)return`ivec3`;if(t$1===4)return`ivec4`;if(t$1===5)return`ivec5`;if(t$1===6)return`ivec6`;throw Error(`GPU for rank ${t$1} is not yet supported`)},e.getGlChannels=function(t$1=6){return[`x`,`y`,`z`,`w`,`u`,`v`].slice(0,t$1)}},7305:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createNewWebGLContext=e.createWebGLContext=void 0;let r=n(6231),i=n(1713),o={};function a(t$1){let e$1=function(){if(typeof document>`u`){if(typeof OffscreenCanvas>`u`)throw TypeError(`failed to create canvas: OffscreenCanvas is not supported`);return new OffscreenCanvas(1,1)}let t$2=document.createElement(`canvas`);return t$2.width=1,t$2.height=1,t$2}(),n$1,o$1={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!t$1||t$1===`webgl2`)&&(n$1=e$1.getContext(`webgl2`,o$1),n$1))try{return new i.WebGLContext(n$1,2)}catch(t$2){r.Logger.warning(`GlContextFactory`,`failed to create WebGLContext using contextId 'webgl2'. Error: ${t$2}`)}if((!t$1||t$1===`webgl`)&&(n$1=e$1.getContext(`webgl`,o$1)||e$1.getContext(`experimental-webgl`,o$1),n$1))try{return new i.WebGLContext(n$1,1)}catch(t$2){r.Logger.warning(`GlContextFactory`,`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t$2}`)}throw Error(`WebGL is not supported`)}e.createWebGLContext=function t$1(e$1){let n$1;e$1&&e$1!==`webgl2`||!(`webgl2`in o)?e$1&&e$1!==`webgl`||!(`webgl`in o)||(n$1=o.webgl):n$1=o.webgl2,n$1||=a(e$1),e$1=e$1||n$1.version===1?`webgl`:`webgl2`;let r$1=n$1.gl;return o[e$1]=n$1,r$1.isContextLost()?(delete o[e$1],t$1(e$1)):(r$1.disable(r$1.DEPTH_TEST),r$1.disable(r$1.STENCIL_TEST),r$1.disable(r$1.BLEND),r$1.disable(r$1.DITHER),r$1.disable(r$1.POLYGON_OFFSET_FILL),r$1.disable(r$1.SAMPLE_COVERAGE),r$1.enable(r$1.SCISSOR_TEST),r$1.enable(r$1.CULL_FACE),r$1.cullFace(r$1.BACK),n$1)},e.createNewWebGLContext=a},1713:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t$1,e$1,n$1,r$1){r$1===void 0&&(r$1=n$1);var i$1=Object.getOwnPropertyDescriptor(e$1,n$1);i$1&&!(`get`in i$1?!e$1.__esModule:i$1.writable||i$1.configurable)||(i$1={enumerable:!0,get:function(){return e$1[n$1]}}),Object.defineProperty(t$1,r$1,i$1)}:function(t$1,e$1,n$1,r$1){r$1===void 0&&(r$1=n$1),t$1[r$1]=e$1[n$1]}),i=this&&this.__setModuleDefault||(Object.create?function(t$1,e$1){Object.defineProperty(t$1,`default`,{enumerable:!0,value:e$1})}:function(t$1,e$1){t$1.default=e$1}),o=this&&this.__importStar||function(t$1){if(t$1&&t$1.__esModule)return t$1;var e$1={};if(t$1!=null)for(var n$1 in t$1)n$1!==`default`&&Object.prototype.hasOwnProperty.call(t$1,n$1)&&r(e$1,t$1,n$1);return i(e$1,t$1),e$1};Object.defineProperty(e,`__esModule`,{value:!0}),e.WebGLContext=e.linearSearchLastTrue=void 0;let a=n(1670),s=o(n(7769)),u=n(9390);function c(t$1){let e$1=0;for(;e$1this.isTimerResultAvailable(t$1)),this.getTimerResult(t$1)}async createAndWaitForFence(){let t$1=this.createFence(this.gl);return this.pollFence(t$1)}createFence(t$1){let e$1,n$1=t$1,r$1=n$1.fenceSync(n$1.SYNC_GPU_COMMANDS_COMPLETE,0);return t$1.flush(),e$1=r$1===null?()=>!0:()=>{let t$2=n$1.clientWaitSync(r$1,0,0);return t$2===n$1.ALREADY_SIGNALED||t$2===n$1.CONDITION_SATISFIED},{query:r$1,isFencePassed:e$1}}async pollFence(t$1){return new Promise(e$1=>{this.addItemToPoll(()=>t$1.isFencePassed(),()=>e$1())})}pollItems(){let t$1=c(this.itemsToPoll.map(t$2=>t$2.isDoneFn));for(let e$1=0;e$1<=t$1;++e$1){let{resolveFn:t$2}=this.itemsToPoll[e$1];t$2()}this.itemsToPoll=this.itemsToPoll.slice(t$1+1)}async addItemToPoll(t$1,e$1){this.itemsToPoll.push({isDoneFn:t$1,resolveFn:e$1}),this.itemsToPoll.length>1||await(0,u.repeatedTry)(()=>(this.pollItems(),this.itemsToPoll.length===0))}}},1036:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.ExecutionPlan=void 0;let r=n(6231);class i{constructor(t$1,e$1){this.op=t$1,this.node=e$1}}e.ExecutionPlan=class{constructor(t$1,e$1,n$1){this.graph=t$1,this.profiler=n$1,this.initialize(e$1)}initialize(t$1){this.profiler.event(`session`,`ExecutionPlan.initialize`,()=>{let e$1=this.graph.getNodes();if(e$1.length!==t$1.length)throw Error(`The size of nodes and OPs do not match.`);this._ops=t$1.map((t$2,n$1)=>new i(t$2,e$1[n$1])),this.reset(),this._starter=[],this._ops.forEach((t$2,e$2)=>{let n$1=!0;for(let e$3 of t$2.node.inputs)if(!this._values[e$3]&&this.graph.getInputIndices().indexOf(e$3)===-1){n$1=!1;break}n$1&&this._starter.push(e$2)})})}reset(){this._values=this.graph.getValues().map(t$1=>t$1.tensor)}async execute(t$1,e$1){return this.profiler.event(`session`,`ExecutionPlan.execute`,async()=>{this.reset();let n$1=t$1.createInferenceHandler(),i$1=this.graph.getInputIndices();if(e$1.length!==i$1.length)throw Error(`number of input tensors don't match the number of inputs to the model: actual: ${e$1.length} expected: ${i$1.length}`);e$1.forEach((t$2,e$2)=>{let n$2=i$1[e$2];this._values[n$2]=t$2});let o=this._starter.slice(0),a=this.graph.getValues(),s=this.graph.getNodes(),u=0;for(;uthis._values[t$3]);if(i$2.indexOf(void 0)!==-1)throw Error(`unresolved input detected: op: ${e$2.node}`);let c$1=i$2;r.Logger.verbose(`ExecPlan`,`Runing op:${e$2.node.name} (${c$1.map((t$3,n$2)=>`'${e$2.node.inputs[n$2]}': ${t$3.type}[${t$3.dims.join(`,`)}]`).join(`, `)})`);let l=await this.profiler.event(`node`,e$2.node.name,async()=>e$2.op.impl(n$1,c$1,e$2.op.context));if(l.length!==e$2.node.outputs.length)throw Error(`the size of output does not match model definition.`);l.forEach((t$3,n$2)=>{let r$1=e$2.node.outputs[n$2];if(this._values[r$1])throw Error(`output [${r$1}] already has value: op:${e$2.node.name}`);this._values[r$1]=t$3});let p$1=new Set;l.forEach((t$3,n$2)=>{let r$1=e$2.node.outputs[n$2];for(let t$4 of a[r$1].to){let e$3=s[t$4],n$3=!0;for(let t$5 of e$3.inputs)if(!this._values[t$5]){n$3=!1;break}n$3&&p$1.add(t$4)}}),o.push(...p$1)}let c=[];for(let t$2=0;t$2{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.Graph=void 0;let r=n(1446),i=n(7778),o=n(9395),a=n(9162),s=n(2517);var u=o.onnxruntime.experimental.fbs;e.Graph={from:(t$1,e$1)=>new p$1(t$1,e$1)};class c{constructor(t$1){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,t$1&&(this.type=s.ProtoUtil.tensorValueTypeFromProto(t$1.type.tensorType))}get from(){return this._from}get to(){return this._to}}class l{constructor(t$1,e$1){t$1 instanceof r.onnx.NodeProto?(this.name=t$1.name,this.opType=t$1.opType,this.attributes=new i.Attribute(t$1.attribute)):t$1 instanceof u.Node&&(this.name=e$1??t$1.name(),this.opType=t$1.opType(),this.attributes=new i.Attribute(s.ProtoUtil.tensorAttributesFromORTFormat(t$1))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class p$1{constructor(t$1,e$1){if(!t$1)throw TypeError(`graph is empty`);this.buildGraph(t$1),this.transformGraph(e$1),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(t$1){if(t$1 instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(t$1);else{if(!(t$1 instanceof u.Graph))throw TypeError(`Graph type is not supported.`);this.buildGraphFromOrtFormat(t$1)}}buildGraphFromOnnxFormat(t$1){let e$1=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];let n$1=new Map;if(!t$1.input)throw Error(`missing information in graph: input`);let r$1=[];for(let n$2 of t$1.input){if(e$1.has(n$2.name))throw Error(`duplicated input name: ${n$2.name}`);let t$2=this._allData.push(new c(n$2))-1;e$1.set(n$2.name,t$2),r$1.push(n$2.name)}if(!t$1.initializer)throw Error(`missing information in graph: initializer`);for(let n$2 of t$1.initializer){let t$2=e$1.get(n$2.name);if(t$2===void 0){let r$2=new c;r$2.type={shape:{dims:s.ProtoUtil.tensorDimsFromProto(n$2.dims)},tensorType:s.ProtoUtil.tensorDataTypeFromProto(n$2.dataType)},t$2=this._allData.push(r$2)-1,e$1.set(n$2.name,t$2)}this._allData[t$2]._from=-1,this._allData[t$2].tensor=a.Tensor.fromProto(n$2)}for(let t$2=0;t$2{this._allData[e$2]._to.forEach(e$3=>{t$1.add(e$3)})});let e$1=Array.from(t$1),n$1=Array(this._nodes.length).fill(`white`);for(;e$1.length>0;){let t$2=e$1.pop();n$1[t$2]===`gray`?n$1[t$2]=`black`:(e$1.push(t$2),n$1[t$2]=`gray`,this._nodes[t$2].outputs.forEach(r$1=>{let i$1=this._allData[r$1];if(i$1.tensor!==void 0)throw Error(`node outputs should not be initialized`);if(i$1._from!==t$2)throw Error(`from property of the Value object doesn't match index of Node being processed`);i$1._to.forEach(t$3=>{if(n$1[t$3]===`gray`)throw Error(`model graph is cyclic`);n$1[t$3]===`white`&&e$1.push(t$3)})}))}}transformGraph(t$1){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),t$1&&t$1.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let t$1=0;for(let e$1=0;e$10&&(this._nodes[e$1].inputs.forEach(n$1=>{let r$1=this._allData[n$1]._to.indexOf(e$1+t$1);r$1!==-1&&(this._allData[n$1]._to[r$1]=e$1)}),this._nodes[e$1].outputs.forEach(n$1=>{this._allData[n$1]._from&&this._allData[n$1]._from===e$1+t$1&&(this._allData[n$1]._from=e$1)})):(t$1++,this._nodes[e$1].outputs.forEach(t$2=>{this._allData[t$2]._from=-2}),this._nodes.splice(e$1,1),e$1--);t$1=0;for(let e$1=0;e$10){let n$1=-1;this._allData[e$1].from!==void 0&&this._allData[e$1].from!==-1?(n$1=this._nodes[this._allData[e$1].from].outputs.indexOf(e$1+t$1),n$1!==-1&&(this._nodes[this._allData[e$1].from].outputs[n$1]=e$1)):(n$1=this._allInputIndices.indexOf(e$1+t$1),n$1!==-1&&(this._allInputIndices[n$1]=e$1)),this._allData[e$1].to.forEach(r$1=>{n$1=this._nodes[r$1].inputs.indexOf(e$1+t$1),n$1!==-1&&(this._nodes[r$1].inputs[n$1]=e$1)}),this._allData[e$1].to.length===0&&(n$1=this._allOutputIndices.indexOf(e$1+t$1),n$1!==-1&&(this._allOutputIndices[n$1]=e$1))}}else t$1++,this._allData.splice(e$1,1),e$1--}deleteNode(t$1){let e$1=this._nodes[t$1];if(e$1.outputs.length>1){for(let t$2=1;t$20)throw Error(`Node deletion with more than one output connected to other nodes is not supported. `)}e$1.executeNode=!1;let n$1=e$1.inputs[0],r$1=e$1.outputs[0],i$1=this._allData[r$1].to,o$1=this._allData[n$1].to.indexOf(t$1);if(o$1===-1)throw Error(`The Value object doesn't have the current Node in it's 'to' property `);this._allData[n$1].to.splice(o$1,1),this._allData[r$1]._to=[];let a$1=this._allOutputIndices.indexOf(r$1);if(a$1!==-1&&(this._allOutputIndices[a$1]=n$1),i$1&&i$1.length>0)for(let t$2 of i$1){let e$2=this._nodes[t$2].inputs.indexOf(r$1);if(e$2===-1)throw Error(`The Node object doesn't have the output Value in it's 'inputs' property `);this._nodes[t$2].inputs[e$2]=n$1,this._allData[n$1].to.push(t$2)}}removeAllDropoutNodes(){let t$1=0;for(let e$1 of this._nodes){if(e$1.opType===`Dropout`){if(e$1.inputs.length!==1)throw Error(`Dropout nodes should only contain one input. `);if(e$1.outputs.length!==1&&e$1.outputs.length!==2)throw Error(`Dropout nodes should contain either 1 or 2 output(s)`);if(e$1.outputs.length===2&&this._allData[e$1.outputs[1]]._to.length!==0)throw Error(`Dropout nodes's second output should not be referenced by other nodes`);this.deleteNode(t$1)}t$1++}}removeAllIdentityNodes(){let t$1=0;for(let e$1 of this._nodes)e$1.opType===`Identity`&&this.deleteNode(t$1),t$1++}isActivation(t$1){switch(t$1.opType){case`Relu`:case`Sigmoid`:case`Clip`:return!0;default:return!1}}fuseConvActivationNodes(){for(let t$1 of this._nodes)if(t$1.opType===`Conv`){let e$1=this._allData[t$1.outputs[0]]._to;if(e$1.length===1&&this.isActivation(this._nodes[e$1[0]])){let n$1=this._nodes[e$1[0]];if(n$1.opType===`Clip`)if(n$1.inputs.length===1)try{t$1.attributes.set(`activation_params`,`floats`,[n$1.attributes.getFloat(`min`),n$1.attributes.getFloat(`max`)])}catch{t$1.attributes.set(`activation_params`,`floats`,[s.MIN_CLIP,s.MAX_CLIP])}else{if(!(n$1.inputs.length>=3&&this._allData[n$1.inputs[1]].tensor!==void 0&&this._allData[n$1.inputs[2]].tensor!==void 0))continue;t$1.attributes.set(`activation_params`,`floats`,[this._allData[n$1.inputs[1]].tensor.floatData[0],this._allData[n$1.inputs[2]].tensor.floatData[0]])}t$1.attributes.set(`activation`,`string`,n$1.opType),this.deleteNode(e$1[0])}}}}},6231:(t,e)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.now=e.Profiler=e.Logger=void 0;let n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(t$1,e$1,n$1){}},console:new class{log(t$1,e$1,n$1){console.log(`${this.color(t$1)} ${n$1?`\x1B[35m`+n$1+`\x1B[0m `:``}${e$1}`)}color(t$1){switch(t$1){case`verbose`:return`\x1B[34;40mv\x1B[0m`;case`info`:return`\x1B[32mi\x1B[0m`;case`warning`:return`\x1B[30;43mw\x1B[0m`;case`error`:return`\x1B[31;40me\x1B[0m`;case`fatal`:return`\x1B[101mf\x1B[0m`;default:throw Error(`unsupported severity: ${t$1}`)}}}},i={provider:`console`,minimalSeverity:`warning`,logDateTime:!0,logSourceLocation:!1},o={"":i};function a(t$1,e$1,n$1,r$1){if(e$1===void 0)return i$1=t$1,{verbose:a.verbose.bind(null,i$1),info:a.info.bind(null,i$1),warning:a.warning.bind(null,i$1),error:a.error.bind(null,i$1),fatal:a.fatal.bind(null,i$1)};if(n$1===void 0)s(t$1,e$1);else if(typeof n$1==`number`&&r$1===void 0)s(t$1,e$1);else if(typeof n$1==`string`&&r$1===void 0)s(t$1,n$1,0,e$1);else{if(typeof n$1!=`string`||typeof r$1!=`number`)throw TypeError(`input is valid`);s(t$1,n$1,0,e$1)}var i$1}function s(t$1,e$1,i$1,a$1){let s$1=o[a$1||``]||o[``];n[t$1]{a$1.then(async e$3=>{i$1&&await i$1.end(),t$2(e$3)},async t$3=>{i$1&&await i$1.end(),e$2(t$3)})});if(!o$1&&i$1){let t$2=i$1.end();if(t$2&&typeof t$2.then==`function`)return new Promise((e$2,n$2)=>{t$2.then(()=>{e$2(a$1)},t$3=>{n$2(t$3)})})}return a$1}begin(t$1,n$1,r$1){if(!this._started)throw Error(`profiler is not started yet`);if(r$1===void 0){let r$2=(0,e.now)();return this.flush(r$2),new u(t$1,n$1,r$2,t$2=>this.endSync(t$2))}{let e$1=r$1.beginTimer();return new u(t$1,n$1,0,async t$2=>this.end(t$2),e$1,r$1)}}async end(t$1){let e$1=await t$1.checkTimer();this._timingEvents.length=this._flushBatchSize||t$1-this._flushTime>=this._flushIntervalInMilliseconds){for(let t$2=this._flushPointer;this._flushPointerperformance.now():Date.now},2644:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.Model=void 0;let r=n(5686),i=n(1446),o=n(7070),a=n(9395),s=n(2517);var u=a.onnxruntime.experimental.fbs;e.Model=class{constructor(){}load(t$1,e$1,n$1){if(!n$1)try{return void this.loadFromOnnxFormat(t$1,e$1)}catch(t$2){if(n$1!==void 0)throw t$2}this.loadFromOrtFormat(t$1,e$1)}loadFromOnnxFormat(t$1,e$1){let n$1=i.onnx.ModelProto.decode(t$1);if(s.LongUtil.longToNumber(n$1.irVersion)<3)throw Error(`only support ONNX model with IR_VERSION>=3`);this._opsets=n$1.opsetImport.map(t$2=>({domain:t$2.domain,version:s.LongUtil.longToNumber(t$2.version)})),this._graph=o.Graph.from(n$1.graph,e$1)}loadFromOrtFormat(t$1,e$1){let n$1=new r.flatbuffers.ByteBuffer(t$1),i$1=u.InferenceSession.getRootAsInferenceSession(n$1).model();if(s.LongUtil.longToNumber(i$1.irVersion())<3)throw Error(`only support ONNX model with IR_VERSION>=3`);this._opsets=[];for(let t$2=0;t$2{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.FLOAT_TYPES=e.INT_TYPES=e.NUMBER_TYPES=void 0,e.NUMBER_TYPES=[`float32`,`float64`,`int32`,`int16`,`int8`,`uint16`,`uint32`,`uint8`],e.INT_TYPES=[`int32`,`int16`,`int8`,`uint16`,`uint32`,`uint8`],e.FLOAT_TYPES=[`float32`,`float64`]},1047:(t,e)=>{"use strict";function n(t$1,e$1){if(e$1.endsWith(`+`)){let n$1=Number.parseInt(e$1.substring(0,e$1.length-1),10);return!isNaN(n$1)&&n$1<=t$1}if(e$1.split(`-`).length===2){let n$1=e$1.split(`-`),r=Number.parseInt(n$1[0],10),i=Number.parseInt(n$1[1],10);return!isNaN(r)&&!isNaN(i)&&r<=t$1&&t$1<=i}return Number.parseInt(e$1,10)===t$1}Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveOperator=void 0,e.resolveOperator=function(t$1,e$1,r){for(let i of r){let r$1=i[0],o=i[1],a=i[2],s=i[3],u=i[4];if(t$1.opType===r$1){for(let t$2 of e$1)if((t$2.domain===o||t$2.domain===`ai.onnx`&&o===``)&&n(t$2.version,a))return{opImpl:s,opInit:u}}}throw TypeError(`cannot resolve operator '${t$1.opType}' with opsets: ${e$1.map(t$2=>`${t$2.domain||`ai.onnx`} v${t$2.version}`).join(`, `)}`)}},9395:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.onnxruntime=void 0;let r=n(5686);var i,o;i=e.onnxruntime||={},function(t$1){let e$1;(function(t$2){t$2[t$2.UNDEFINED=0]=`UNDEFINED`,t$2[t$2.FLOAT=1]=`FLOAT`,t$2[t$2.INT=2]=`INT`,t$2[t$2.STRING=3]=`STRING`,t$2[t$2.TENSOR=4]=`TENSOR`,t$2[t$2.GRAPH=5]=`GRAPH`,t$2[t$2.FLOATS=6]=`FLOATS`,t$2[t$2.INTS=7]=`INTS`,t$2[t$2.STRINGS=8]=`STRINGS`,t$2[t$2.TENSORS=9]=`TENSORS`,t$2[t$2.GRAPHS=10]=`GRAPHS`,t$2[t$2.SPARSE_TENSOR=11]=`SPARSE_TENSOR`,t$2[t$2.SPARSE_TENSORS=12]=`SPARSE_TENSORS`})(e$1=t$1.AttributeType||={})}((o=i.experimental||={}).fbs||(o.fbs={})),function(t$1){(function(t$2){(function(t$3){let e$1;(function(t$4){t$4[t$4.UNKNOWN=0]=`UNKNOWN`,t$4[t$4.VALUE=1]=`VALUE`,t$4[t$4.PARAM=2]=`PARAM`})(e$1=t$3.DimensionValueType||={})})(t$2.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(t$2){(function(t$3){let e$1;(function(t$4){t$4[t$4.UNDEFINED=0]=`UNDEFINED`,t$4[t$4.FLOAT=1]=`FLOAT`,t$4[t$4.UINT8=2]=`UINT8`,t$4[t$4.INT8=3]=`INT8`,t$4[t$4.UINT16=4]=`UINT16`,t$4[t$4.INT16=5]=`INT16`,t$4[t$4.INT32=6]=`INT32`,t$4[t$4.INT64=7]=`INT64`,t$4[t$4.STRING=8]=`STRING`,t$4[t$4.BOOL=9]=`BOOL`,t$4[t$4.FLOAT16=10]=`FLOAT16`,t$4[t$4.DOUBLE=11]=`DOUBLE`,t$4[t$4.UINT32=12]=`UINT32`,t$4[t$4.UINT64=13]=`UINT64`,t$4[t$4.COMPLEX64=14]=`COMPLEX64`,t$4[t$4.COMPLEX128=15]=`COMPLEX128`,t$4[t$4.BFLOAT16=16]=`BFLOAT16`})(e$1=t$3.TensorDataType||={})})(t$2.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(t$2){(function(t$3){let e$1;(function(t$4){t$4[t$4.Primitive=0]=`Primitive`,t$4[t$4.Fused=1]=`Fused`})(e$1=t$3.NodeType||={})})(t$2.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(t$2){(function(t$3){let e$1;(function(t$4){t$4[t$4.NONE=0]=`NONE`,t$4[t$4.tensor_type=1]=`tensor_type`,t$4[t$4.sequence_type=2]=`sequence_type`,t$4[t$4.map_type=3]=`map_type`})(e$1=t$3.TypeInfoValue||={})})(t$2.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsShape(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsShape(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}dim(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,4);return r$1?(n$2||new t$1.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}dimLength(){let t$2=this.bb.__offset(this.bb_pos,4);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}static startShape(t$2){t$2.startObject(1)}static addDim(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static createDimVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startDimVector(t$2,e$3){t$2.startVector(4,e$3,4)}static endShape(t$2){return t$2.endObject()}static createShape(t$2,e$3){return n$1.startShape(t$2),n$1.addDim(t$2,e$3),n$1.endShape(t$2)}}e$2.Shape=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsDimension(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsDimension(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}value(e$3){let n$2=this.bb.__offset(this.bb_pos,4);return n$2?(e$3||new t$1.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}denotation(t$2){let e$3=this.bb.__offset(this.bb_pos,6);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}static startDimension(t$2){t$2.startObject(2)}static addValue(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addDenotation(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static endDimension(t$2){return t$2.endObject()}static createDimension(t$2,e$3,r$1){return n$1.startDimension(t$2),n$1.addValue(t$2,e$3),n$1.addDenotation(t$2,r$1),n$1.endDimension(t$2)}}e$2.Dimension=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsDimensionValue(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsDimensionValue(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}dimType(){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.readInt8(this.bb_pos+e$3):t$1.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let t$2=this.bb.__offset(this.bb_pos,6);return t$2?this.bb.readInt64(this.bb_pos+t$2):this.bb.createLong(0,0)}dimParam(t$2){let e$3=this.bb.__offset(this.bb_pos,8);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}static startDimensionValue(t$2){t$2.startObject(3)}static addDimType(e$3,n$2){e$3.addFieldInt8(0,n$2,t$1.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(t$2,e$3){t$2.addFieldInt64(1,e$3,t$2.createLong(0,0))}static addDimParam(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static endDimensionValue(t$2){return t$2.endObject()}static createDimensionValue(t$2,e$3,r$1,i$1){return n$1.startDimensionValue(t$2),n$1.addDimType(t$2,e$3),n$1.addDimValue(t$2,r$1),n$1.addDimParam(t$2,i$1),n$1.endDimensionValue(t$2)}}e$2.DimensionValue=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsTensorTypeAndShape(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsTensorTypeAndShape(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}elemType(){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.readInt32(this.bb_pos+e$3):t$1.experimental.fbs.TensorDataType.UNDEFINED}shape(e$3){let n$2=this.bb.__offset(this.bb_pos,6);return n$2?(e$3||new t$1.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}static startTensorTypeAndShape(t$2){t$2.startObject(2)}static addElemType(e$3,n$2){e$3.addFieldInt32(0,n$2,t$1.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static endTensorTypeAndShape(t$2){return t$2.endObject()}static createTensorTypeAndShape(t$2,e$3,r$1){return n$1.startTensorTypeAndShape(t$2),n$1.addElemType(t$2,e$3),n$1.addShape(t$2,r$1),n$1.endTensorTypeAndShape(t$2)}}e$2.TensorTypeAndShape=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsMapType(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsMapType(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}keyType(){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.readInt32(this.bb_pos+e$3):t$1.experimental.fbs.TensorDataType.UNDEFINED}valueType(e$3){let n$2=this.bb.__offset(this.bb_pos,6);return n$2?(e$3||new t$1.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}static startMapType(t$2){t$2.startObject(2)}static addKeyType(e$3,n$2){e$3.addFieldInt32(0,n$2,t$1.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static endMapType(t$2){return t$2.endObject()}static createMapType(t$2,e$3,r$1){return n$1.startMapType(t$2),n$1.addKeyType(t$2,e$3),n$1.addValueType(t$2,r$1),n$1.endMapType(t$2)}}e$2.MapType=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsSequenceType(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsSequenceType(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}elemType(e$3){let n$2=this.bb.__offset(this.bb_pos,4);return n$2?(e$3||new t$1.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}static startSequenceType(t$2){t$2.startObject(1)}static addElemType(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static endSequenceType(t$2){return t$2.endObject()}static createSequenceType(t$2,e$3){return n$1.startSequenceType(t$2),n$1.addElemType(t$2,e$3),n$1.endSequenceType(t$2)}}e$2.SequenceType=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(t$2){(t$2.fbs||={}).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(t$3,e$1){return this.bb_pos=t$3,this.bb=e$1,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(t$3,e$1,n$1,r$1){return t$3.prep(4,12),t$3.writeInt32(r$1),t$3.writeInt32(n$1),t$3.writeInt32(e$1),t$3.offset()}}})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsNodeEdge(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsNodeEdge(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}nodeIndex(){let t$2=this.bb.__offset(this.bb_pos,4);return t$2?this.bb.readUint32(this.bb_pos+t$2):0}inputEdges(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,6);return r$1?(n$2||new t$1.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r$1)+12*e$3,this.bb):null}inputEdgesLength(){let t$2=this.bb.__offset(this.bb_pos,6);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}outputEdges(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,8);return r$1?(n$2||new t$1.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r$1)+12*e$3,this.bb):null}outputEdgesLength(){let t$2=this.bb.__offset(this.bb_pos,8);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}static startNodeEdge(t$2){t$2.startObject(3)}static addNodeIndex(t$2,e$3){t$2.addFieldInt32(0,e$3,0)}static addInputEdges(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static startInputEdgesVector(t$2,e$3){t$2.startVector(12,e$3,4)}static addOutputEdges(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static startOutputEdgesVector(t$2,e$3){t$2.startVector(12,e$3,4)}static endNodeEdge(t$2){return t$2.endObject()}static createNodeEdge(t$2,e$3,r$1,i$1){return n$1.startNodeEdge(t$2),n$1.addNodeIndex(t$2,e$3),n$1.addInputEdges(t$2,r$1),n$1.addOutputEdges(t$2,i$1),n$1.endNodeEdge(t$2)}}e$2.NodeEdge=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsNode(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsNode(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}name(t$2){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}docString(t$2){let e$3=this.bb.__offset(this.bb_pos,6);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}domain(t$2){let e$3=this.bb.__offset(this.bb_pos,8);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}sinceVersion(){let t$2=this.bb.__offset(this.bb_pos,10);return t$2?this.bb.readInt32(this.bb_pos+t$2):0}index(){let t$2=this.bb.__offset(this.bb_pos,12);return t$2?this.bb.readUint32(this.bb_pos+t$2):0}opType(t$2){let e$3=this.bb.__offset(this.bb_pos,14);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}type(){let e$3=this.bb.__offset(this.bb_pos,16);return e$3?this.bb.readInt32(this.bb_pos+e$3):t$1.experimental.fbs.NodeType.Primitive}executionProviderType(t$2){let e$3=this.bb.__offset(this.bb_pos,18);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}inputs(t$2,e$3){let n$2=this.bb.__offset(this.bb_pos,20);return n$2?this.bb.__string(this.bb.__vector(this.bb_pos+n$2)+4*t$2,e$3):null}inputsLength(){let t$2=this.bb.__offset(this.bb_pos,20);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}outputs(t$2,e$3){let n$2=this.bb.__offset(this.bb_pos,22);return n$2?this.bb.__string(this.bb.__vector(this.bb_pos+n$2)+4*t$2,e$3):null}outputsLength(){let t$2=this.bb.__offset(this.bb_pos,22);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}attributes(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,24);return r$1?(n$2||new t$1.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}attributesLength(){let t$2=this.bb.__offset(this.bb_pos,24);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}inputArgCounts(t$2){let e$3=this.bb.__offset(this.bb_pos,26);return e$3?this.bb.readInt32(this.bb.__vector(this.bb_pos+e$3)+4*t$2):0}inputArgCountsLength(){let t$2=this.bb.__offset(this.bb_pos,26);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}inputArgCountsArray(){let t$2=this.bb.__offset(this.bb_pos,26);return t$2?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t$2),this.bb.__vector_len(this.bb_pos+t$2)):null}implicitInputs(t$2,e$3){let n$2=this.bb.__offset(this.bb_pos,28);return n$2?this.bb.__string(this.bb.__vector(this.bb_pos+n$2)+4*t$2,e$3):null}implicitInputsLength(){let t$2=this.bb.__offset(this.bb_pos,28);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}static startNode(t$2){t$2.startObject(13)}static addName(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addDocString(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static addDomain(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static addSinceVersion(t$2,e$3){t$2.addFieldInt32(3,e$3,0)}static addIndex(t$2,e$3){t$2.addFieldInt32(4,e$3,0)}static addOpType(t$2,e$3){t$2.addFieldOffset(5,e$3,0)}static addType(e$3,n$2){e$3.addFieldInt32(6,n$2,t$1.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(t$2,e$3){t$2.addFieldOffset(7,e$3,0)}static addInputs(t$2,e$3){t$2.addFieldOffset(8,e$3,0)}static createInputsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startInputsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addOutputs(t$2,e$3){t$2.addFieldOffset(9,e$3,0)}static createOutputsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startOutputsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addAttributes(t$2,e$3){t$2.addFieldOffset(10,e$3,0)}static createAttributesVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startAttributesVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addInputArgCounts(t$2,e$3){t$2.addFieldOffset(11,e$3,0)}static createInputArgCountsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addInt32(e$3[n$2]);return t$2.endVector()}static startInputArgCountsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addImplicitInputs(t$2,e$3){t$2.addFieldOffset(12,e$3,0)}static createImplicitInputsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startImplicitInputsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static endNode(t$2){return t$2.endObject()}static createNode(t$2,e$3,r$1,i$1,o$1,a,s,u,c,l,p$1,f,d,h){return n$1.startNode(t$2),n$1.addName(t$2,e$3),n$1.addDocString(t$2,r$1),n$1.addDomain(t$2,i$1),n$1.addSinceVersion(t$2,o$1),n$1.addIndex(t$2,a),n$1.addOpType(t$2,s),n$1.addType(t$2,u),n$1.addExecutionProviderType(t$2,c),n$1.addInputs(t$2,l),n$1.addOutputs(t$2,p$1),n$1.addAttributes(t$2,f),n$1.addInputArgCounts(t$2,d),n$1.addImplicitInputs(t$2,h),n$1.endNode(t$2)}}e$2.Node=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsValueInfo(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsValueInfo(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}name(t$2){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}docString(t$2){let e$3=this.bb.__offset(this.bb_pos,6);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}type(e$3){let n$2=this.bb.__offset(this.bb_pos,8);return n$2?(e$3||new t$1.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}static startValueInfo(t$2){t$2.startObject(3)}static addName(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addDocString(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static addType(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static endValueInfo(t$2){return t$2.endObject()}static createValueInfo(t$2,e$3,r$1,i$1){return n$1.startValueInfo(t$2),n$1.addName(t$2,e$3),n$1.addDocString(t$2,r$1),n$1.addType(t$2,i$1),n$1.endValueInfo(t$2)}}e$2.ValueInfo=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsTypeInfo(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsTypeInfo(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}denotation(t$2){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}valueType(){let e$3=this.bb.__offset(this.bb_pos,6);return e$3?this.bb.readUint8(this.bb_pos+e$3):t$1.experimental.fbs.TypeInfoValue.NONE}value(t$2){let e$3=this.bb.__offset(this.bb_pos,8);return e$3?this.bb.__union(t$2,this.bb_pos+e$3):null}static startTypeInfo(t$2){t$2.startObject(3)}static addDenotation(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addValueType(e$3,n$2){e$3.addFieldInt8(1,n$2,t$1.experimental.fbs.TypeInfoValue.NONE)}static addValue(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static endTypeInfo(t$2){return t$2.endObject()}static createTypeInfo(t$2,e$3,r$1,i$1){return n$1.startTypeInfo(t$2),n$1.addDenotation(t$2,e$3),n$1.addValueType(t$2,r$1),n$1.addValue(t$2,i$1),n$1.endTypeInfo(t$2)}}e$2.TypeInfo=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(t$2){(function(t$3){class e$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$4,e$2){return this.bb_pos=t$4,this.bb=e$2,this}static getRootAsOperatorSetId(t$4,n$1){return(n$1||new e$1).__init(t$4.readInt32(t$4.position())+t$4.position(),t$4)}static getSizePrefixedRootAsOperatorSetId(t$4,n$1){return t$4.setPosition(t$4.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n$1||new e$1).__init(t$4.readInt32(t$4.position())+t$4.position(),t$4)}domain(t$4){let e$2=this.bb.__offset(this.bb_pos,4);return e$2?this.bb.__string(this.bb_pos+e$2,t$4):null}version(){let t$4=this.bb.__offset(this.bb_pos,6);return t$4?this.bb.readInt64(this.bb_pos+t$4):this.bb.createLong(0,0)}static startOperatorSetId(t$4){t$4.startObject(2)}static addDomain(t$4,e$2){t$4.addFieldOffset(0,e$2,0)}static addVersion(t$4,e$2){t$4.addFieldInt64(1,e$2,t$4.createLong(0,0))}static endOperatorSetId(t$4){return t$4.endObject()}static createOperatorSetId(t$4,n$1,r$1){return e$1.startOperatorSetId(t$4),e$1.addDomain(t$4,n$1),e$1.addVersion(t$4,r$1),e$1.endOperatorSetId(t$4)}}t$3.OperatorSetId=e$1})(t$2.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsTensor(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsTensor(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}name(t$2){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}docString(t$2){let e$3=this.bb.__offset(this.bb_pos,6);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}dims(t$2){let e$3=this.bb.__offset(this.bb_pos,8);return e$3?this.bb.readInt64(this.bb.__vector(this.bb_pos+e$3)+8*t$2):this.bb.createLong(0,0)}dimsLength(){let t$2=this.bb.__offset(this.bb_pos,8);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}dataType(){let e$3=this.bb.__offset(this.bb_pos,10);return e$3?this.bb.readInt32(this.bb_pos+e$3):t$1.experimental.fbs.TensorDataType.UNDEFINED}rawData(t$2){let e$3=this.bb.__offset(this.bb_pos,12);return e$3?this.bb.readUint8(this.bb.__vector(this.bb_pos+e$3)+t$2):0}rawDataLength(){let t$2=this.bb.__offset(this.bb_pos,12);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}rawDataArray(){let t$2=this.bb.__offset(this.bb_pos,12);return t$2?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t$2),this.bb.__vector_len(this.bb_pos+t$2)):null}stringData(t$2,e$3){let n$2=this.bb.__offset(this.bb_pos,14);return n$2?this.bb.__string(this.bb.__vector(this.bb_pos+n$2)+4*t$2,e$3):null}stringDataLength(){let t$2=this.bb.__offset(this.bb_pos,14);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}static startTensor(t$2){t$2.startObject(6)}static addName(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addDocString(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static addDims(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static createDimsVector(t$2,e$3){t$2.startVector(8,e$3.length,8);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addInt64(e$3[n$2]);return t$2.endVector()}static startDimsVector(t$2,e$3){t$2.startVector(8,e$3,8)}static addDataType(e$3,n$2){e$3.addFieldInt32(3,n$2,t$1.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(t$2,e$3){t$2.addFieldOffset(4,e$3,0)}static createRawDataVector(t$2,e$3){t$2.startVector(1,e$3.length,1);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addInt8(e$3[n$2]);return t$2.endVector()}static startRawDataVector(t$2,e$3){t$2.startVector(1,e$3,1)}static addStringData(t$2,e$3){t$2.addFieldOffset(5,e$3,0)}static createStringDataVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startStringDataVector(t$2,e$3){t$2.startVector(4,e$3,4)}static endTensor(t$2){return t$2.endObject()}static createTensor(t$2,e$3,r$1,i$1,o$1,a,s){return n$1.startTensor(t$2),n$1.addName(t$2,e$3),n$1.addDocString(t$2,r$1),n$1.addDims(t$2,i$1),n$1.addDataType(t$2,o$1),n$1.addRawData(t$2,a),n$1.addStringData(t$2,s),n$1.endTensor(t$2)}}e$2.Tensor=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsSparseTensor(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsSparseTensor(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}values(e$3){let n$2=this.bb.__offset(this.bb_pos,4);return n$2?(e$3||new t$1.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}indices(e$3){let n$2=this.bb.__offset(this.bb_pos,6);return n$2?(e$3||new t$1.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}dims(t$2){let e$3=this.bb.__offset(this.bb_pos,8);return e$3?this.bb.readInt64(this.bb.__vector(this.bb_pos+e$3)+8*t$2):this.bb.createLong(0,0)}dimsLength(){let t$2=this.bb.__offset(this.bb_pos,8);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}static startSparseTensor(t$2){t$2.startObject(3)}static addValues(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addIndices(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static addDims(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static createDimsVector(t$2,e$3){t$2.startVector(8,e$3.length,8);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addInt64(e$3[n$2]);return t$2.endVector()}static startDimsVector(t$2,e$3){t$2.startVector(8,e$3,8)}static endSparseTensor(t$2){return t$2.endObject()}static createSparseTensor(t$2,e$3,r$1,i$1){return n$1.startSparseTensor(t$2),n$1.addValues(t$2,e$3),n$1.addIndices(t$2,r$1),n$1.addDims(t$2,i$1),n$1.endSparseTensor(t$2)}}e$2.SparseTensor=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsAttribute(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsAttribute(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}name(t$2){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}docString(t$2){let e$3=this.bb.__offset(this.bb_pos,6);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}type(){let e$3=this.bb.__offset(this.bb_pos,8);return e$3?this.bb.readInt32(this.bb_pos+e$3):t$1.experimental.fbs.AttributeType.UNDEFINED}f(){let t$2=this.bb.__offset(this.bb_pos,10);return t$2?this.bb.readFloat32(this.bb_pos+t$2):0}i(){let t$2=this.bb.__offset(this.bb_pos,12);return t$2?this.bb.readInt64(this.bb_pos+t$2):this.bb.createLong(0,0)}s(t$2){let e$3=this.bb.__offset(this.bb_pos,14);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}t(e$3){let n$2=this.bb.__offset(this.bb_pos,16);return n$2?(e$3||new t$1.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}g(e$3){let n$2=this.bb.__offset(this.bb_pos,18);return n$2?(e$3||new t$1.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}floats(t$2){let e$3=this.bb.__offset(this.bb_pos,20);return e$3?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e$3)+4*t$2):0}floatsLength(){let t$2=this.bb.__offset(this.bb_pos,20);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}floatsArray(){let t$2=this.bb.__offset(this.bb_pos,20);return t$2?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t$2),this.bb.__vector_len(this.bb_pos+t$2)):null}ints(t$2){let e$3=this.bb.__offset(this.bb_pos,22);return e$3?this.bb.readInt64(this.bb.__vector(this.bb_pos+e$3)+8*t$2):this.bb.createLong(0,0)}intsLength(){let t$2=this.bb.__offset(this.bb_pos,22);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}strings(t$2,e$3){let n$2=this.bb.__offset(this.bb_pos,24);return n$2?this.bb.__string(this.bb.__vector(this.bb_pos+n$2)+4*t$2,e$3):null}stringsLength(){let t$2=this.bb.__offset(this.bb_pos,24);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}tensors(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,26);return r$1?(n$2||new t$1.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}tensorsLength(){let t$2=this.bb.__offset(this.bb_pos,26);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}graphs(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,28);return r$1?(n$2||new t$1.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}graphsLength(){let t$2=this.bb.__offset(this.bb_pos,28);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}static startAttribute(t$2){t$2.startObject(13)}static addName(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addDocString(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static addType(e$3,n$2){e$3.addFieldInt32(2,n$2,t$1.experimental.fbs.AttributeType.UNDEFINED)}static addF(t$2,e$3){t$2.addFieldFloat32(3,e$3,0)}static addI(t$2,e$3){t$2.addFieldInt64(4,e$3,t$2.createLong(0,0))}static addS(t$2,e$3){t$2.addFieldOffset(5,e$3,0)}static addT(t$2,e$3){t$2.addFieldOffset(6,e$3,0)}static addG(t$2,e$3){t$2.addFieldOffset(7,e$3,0)}static addFloats(t$2,e$3){t$2.addFieldOffset(8,e$3,0)}static createFloatsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addFloat32(e$3[n$2]);return t$2.endVector()}static startFloatsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addInts(t$2,e$3){t$2.addFieldOffset(9,e$3,0)}static createIntsVector(t$2,e$3){t$2.startVector(8,e$3.length,8);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addInt64(e$3[n$2]);return t$2.endVector()}static startIntsVector(t$2,e$3){t$2.startVector(8,e$3,8)}static addStrings(t$2,e$3){t$2.addFieldOffset(10,e$3,0)}static createStringsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startStringsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addTensors(t$2,e$3){t$2.addFieldOffset(11,e$3,0)}static createTensorsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startTensorsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addGraphs(t$2,e$3){t$2.addFieldOffset(12,e$3,0)}static createGraphsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startGraphsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static endAttribute(t$2){return t$2.endObject()}static createAttribute(t$2,e$3,r$1,i$1,o$1,a,s,u,c,l,p$1,f,d,h){return n$1.startAttribute(t$2),n$1.addName(t$2,e$3),n$1.addDocString(t$2,r$1),n$1.addType(t$2,i$1),n$1.addF(t$2,o$1),n$1.addI(t$2,a),n$1.addS(t$2,s),n$1.addT(t$2,u),n$1.addG(t$2,c),n$1.addFloats(t$2,l),n$1.addInts(t$2,p$1),n$1.addStrings(t$2,f),n$1.addTensors(t$2,d),n$1.addGraphs(t$2,h),n$1.endAttribute(t$2)}}e$2.Attribute=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsGraph(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsGraph(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}initializers(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,4);return r$1?(n$2||new t$1.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}initializersLength(){let t$2=this.bb.__offset(this.bb_pos,4);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}nodeArgs(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,6);return r$1?(n$2||new t$1.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}nodeArgsLength(){let t$2=this.bb.__offset(this.bb_pos,6);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}nodes(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,8);return r$1?(n$2||new t$1.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}nodesLength(){let t$2=this.bb.__offset(this.bb_pos,8);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}maxNodeIndex(){let t$2=this.bb.__offset(this.bb_pos,10);return t$2?this.bb.readUint32(this.bb_pos+t$2):0}nodeEdges(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,12);return r$1?(n$2||new t$1.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}nodeEdgesLength(){let t$2=this.bb.__offset(this.bb_pos,12);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}inputs(t$2,e$3){let n$2=this.bb.__offset(this.bb_pos,14);return n$2?this.bb.__string(this.bb.__vector(this.bb_pos+n$2)+4*t$2,e$3):null}inputsLength(){let t$2=this.bb.__offset(this.bb_pos,14);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}outputs(t$2,e$3){let n$2=this.bb.__offset(this.bb_pos,16);return n$2?this.bb.__string(this.bb.__vector(this.bb_pos+n$2)+4*t$2,e$3):null}outputsLength(){let t$2=this.bb.__offset(this.bb_pos,16);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}sparseInitializers(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,18);return r$1?(n$2||new t$1.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}sparseInitializersLength(){let t$2=this.bb.__offset(this.bb_pos,18);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}static startGraph(t$2){t$2.startObject(8)}static addInitializers(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static createInitializersVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startInitializersVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addNodeArgs(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static createNodeArgsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startNodeArgsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addNodes(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static createNodesVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startNodesVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addMaxNodeIndex(t$2,e$3){t$2.addFieldInt32(3,e$3,0)}static addNodeEdges(t$2,e$3){t$2.addFieldOffset(4,e$3,0)}static createNodeEdgesVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startNodeEdgesVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addInputs(t$2,e$3){t$2.addFieldOffset(5,e$3,0)}static createInputsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startInputsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addOutputs(t$2,e$3){t$2.addFieldOffset(6,e$3,0)}static createOutputsVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startOutputsVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addSparseInitializers(t$2,e$3){t$2.addFieldOffset(7,e$3,0)}static createSparseInitializersVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startSparseInitializersVector(t$2,e$3){t$2.startVector(4,e$3,4)}static endGraph(t$2){return t$2.endObject()}static createGraph(t$2,e$3,r$1,i$1,o$1,a,s,u,c){return n$1.startGraph(t$2),n$1.addInitializers(t$2,e$3),n$1.addNodeArgs(t$2,r$1),n$1.addNodes(t$2,i$1),n$1.addMaxNodeIndex(t$2,o$1),n$1.addNodeEdges(t$2,a),n$1.addInputs(t$2,s),n$1.addOutputs(t$2,u),n$1.addSparseInitializers(t$2,c),n$1.endGraph(t$2)}}e$2.Graph=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsModel(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsModel(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}irVersion(){let t$2=this.bb.__offset(this.bb_pos,4);return t$2?this.bb.readInt64(this.bb_pos+t$2):this.bb.createLong(0,0)}opsetImport(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,6);return r$1?(n$2||new t$1.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}opsetImportLength(){let t$2=this.bb.__offset(this.bb_pos,6);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}producerName(t$2){let e$3=this.bb.__offset(this.bb_pos,8);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}producerVersion(t$2){let e$3=this.bb.__offset(this.bb_pos,10);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}domain(t$2){let e$3=this.bb.__offset(this.bb_pos,12);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}modelVersion(){let t$2=this.bb.__offset(this.bb_pos,14);return t$2?this.bb.readInt64(this.bb_pos+t$2):this.bb.createLong(0,0)}docString(t$2){let e$3=this.bb.__offset(this.bb_pos,16);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}graph(e$3){let n$2=this.bb.__offset(this.bb_pos,18);return n$2?(e$3||new t$1.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}graphDocString(t$2){let e$3=this.bb.__offset(this.bb_pos,20);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}static startModel(t$2){t$2.startObject(9)}static addIrVersion(t$2,e$3){t$2.addFieldInt64(0,e$3,t$2.createLong(0,0))}static addOpsetImport(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static createOpsetImportVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startOpsetImportVector(t$2,e$3){t$2.startVector(4,e$3,4)}static addProducerName(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static addProducerVersion(t$2,e$3){t$2.addFieldOffset(3,e$3,0)}static addDomain(t$2,e$3){t$2.addFieldOffset(4,e$3,0)}static addModelVersion(t$2,e$3){t$2.addFieldInt64(5,e$3,t$2.createLong(0,0))}static addDocString(t$2,e$3){t$2.addFieldOffset(6,e$3,0)}static addGraph(t$2,e$3){t$2.addFieldOffset(7,e$3,0)}static addGraphDocString(t$2,e$3){t$2.addFieldOffset(8,e$3,0)}static endModel(t$2){return t$2.endObject()}static createModel(t$2,e$3,r$1,i$1,o$1,a,s,u,c,l){return n$1.startModel(t$2),n$1.addIrVersion(t$2,e$3),n$1.addOpsetImport(t$2,r$1),n$1.addProducerName(t$2,i$1),n$1.addProducerVersion(t$2,o$1),n$1.addDomain(t$2,a),n$1.addModelVersion(t$2,s),n$1.addDocString(t$2,u),n$1.addGraph(t$2,c),n$1.addGraphDocString(t$2,l),n$1.endModel(t$2)}}e$2.Model=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(t$2){(function(t$3){class e$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$4,e$2){return this.bb_pos=t$4,this.bb=e$2,this}static getRootAsKernelCreateInfos(t$4,n$1){return(n$1||new e$1).__init(t$4.readInt32(t$4.position())+t$4.position(),t$4)}static getSizePrefixedRootAsKernelCreateInfos(t$4,n$1){return t$4.setPosition(t$4.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n$1||new e$1).__init(t$4.readInt32(t$4.position())+t$4.position(),t$4)}nodeIndices(t$4){let e$2=this.bb.__offset(this.bb_pos,4);return e$2?this.bb.readUint32(this.bb.__vector(this.bb_pos+e$2)+4*t$4):0}nodeIndicesLength(){let t$4=this.bb.__offset(this.bb_pos,4);return t$4?this.bb.__vector_len(this.bb_pos+t$4):0}nodeIndicesArray(){let t$4=this.bb.__offset(this.bb_pos,4);return t$4?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t$4),this.bb.__vector_len(this.bb_pos+t$4)):null}kernelDefHashes(t$4){let e$2=this.bb.__offset(this.bb_pos,6);return e$2?this.bb.readUint64(this.bb.__vector(this.bb_pos+e$2)+8*t$4):this.bb.createLong(0,0)}kernelDefHashesLength(){let t$4=this.bb.__offset(this.bb_pos,6);return t$4?this.bb.__vector_len(this.bb_pos+t$4):0}static startKernelCreateInfos(t$4){t$4.startObject(2)}static addNodeIndices(t$4,e$2){t$4.addFieldOffset(0,e$2,0)}static createNodeIndicesVector(t$4,e$2){t$4.startVector(4,e$2.length,4);for(let n$1=e$2.length-1;n$1>=0;n$1--)t$4.addInt32(e$2[n$1]);return t$4.endVector()}static startNodeIndicesVector(t$4,e$2){t$4.startVector(4,e$2,4)}static addKernelDefHashes(t$4,e$2){t$4.addFieldOffset(1,e$2,0)}static createKernelDefHashesVector(t$4,e$2){t$4.startVector(8,e$2.length,8);for(let n$1=e$2.length-1;n$1>=0;n$1--)t$4.addInt64(e$2[n$1]);return t$4.endVector()}static startKernelDefHashesVector(t$4,e$2){t$4.startVector(8,e$2,8)}static endKernelCreateInfos(t$4){return t$4.endObject()}static createKernelCreateInfos(t$4,n$1,r$1){return e$1.startKernelCreateInfos(t$4),e$1.addNodeIndices(t$4,n$1),e$1.addKernelDefHashes(t$4,r$1),e$1.endKernelCreateInfos(t$4)}}t$3.KernelCreateInfos=e$1})(t$2.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsSubGraphSessionState(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsSubGraphSessionState(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}graphId(t$2){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}sessionState(e$3){let n$2=this.bb.__offset(this.bb_pos,6);return n$2?(e$3||new t$1.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}static startSubGraphSessionState(t$2){t$2.startObject(2)}static addGraphId(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addSessionState(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static endSubGraphSessionState(t$2){let e$3=t$2.endObject();return t$2.requiredField(e$3,4),e$3}static createSubGraphSessionState(t$2,e$3,r$1){return n$1.startSubGraphSessionState(t$2),n$1.addGraphId(t$2,e$3),n$1.addSessionState(t$2,r$1),n$1.endSubGraphSessionState(t$2)}}e$2.SubGraphSessionState=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsSessionState(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsSessionState(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}kernels(e$3){let n$2=this.bb.__offset(this.bb_pos,4);return n$2?(e$3||new t$1.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}subGraphSessionStates(e$3,n$2){let r$1=this.bb.__offset(this.bb_pos,6);return r$1?(n$2||new t$1.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r$1)+4*e$3),this.bb):null}subGraphSessionStatesLength(){let t$2=this.bb.__offset(this.bb_pos,6);return t$2?this.bb.__vector_len(this.bb_pos+t$2):0}static startSessionState(t$2){t$2.startObject(2)}static addKernels(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addSubGraphSessionStates(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static createSubGraphSessionStatesVector(t$2,e$3){t$2.startVector(4,e$3.length,4);for(let n$2=e$3.length-1;n$2>=0;n$2--)t$2.addOffset(e$3[n$2]);return t$2.endVector()}static startSubGraphSessionStatesVector(t$2,e$3){t$2.startVector(4,e$3,4)}static endSessionState(t$2){return t$2.endObject()}static createSessionState(t$2,e$3,r$1){return n$1.startSessionState(t$2),n$1.addKernels(t$2,e$3),n$1.addSubGraphSessionStates(t$2,r$1),n$1.endSessionState(t$2)}}e$2.SessionState=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={}),function(t$1){(function(e$1){(function(e$2){class n$1{constructor(){this.bb=null,this.bb_pos=0}__init(t$2,e$3){return this.bb_pos=t$2,this.bb=e$3,this}static getRootAsInferenceSession(t$2,e$3){return(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static getSizePrefixedRootAsInferenceSession(t$2,e$3){return t$2.setPosition(t$2.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(e$3||new n$1).__init(t$2.readInt32(t$2.position())+t$2.position(),t$2)}static bufferHasIdentifier(t$2){return t$2.__has_identifier(`ORTM`)}ortVersion(t$2){let e$3=this.bb.__offset(this.bb_pos,4);return e$3?this.bb.__string(this.bb_pos+e$3,t$2):null}model(e$3){let n$2=this.bb.__offset(this.bb_pos,6);return n$2?(e$3||new t$1.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}sessionState(e$3){let n$2=this.bb.__offset(this.bb_pos,8);return n$2?(e$3||new t$1.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n$2),this.bb):null}static startInferenceSession(t$2){t$2.startObject(3)}static addOrtVersion(t$2,e$3){t$2.addFieldOffset(0,e$3,0)}static addModel(t$2,e$3){t$2.addFieldOffset(1,e$3,0)}static addSessionState(t$2,e$3){t$2.addFieldOffset(2,e$3,0)}static endInferenceSession(t$2){return t$2.endObject()}static finishInferenceSessionBuffer(t$2,e$3){t$2.finish(e$3,`ORTM`)}static finishSizePrefixedInferenceSessionBuffer(t$2,e$3){t$2.finish(e$3,`ORTM`,!0)}static createInferenceSession(t$2,e$3,r$1,i$1){return n$1.startInferenceSession(t$2),n$1.addOrtVersion(t$2,e$3),n$1.addModel(t$2,r$1),n$1.addSessionState(t$2,i$1),n$1.endInferenceSession(t$2)}}e$2.InferenceSession=n$1})(e$1.fbs||={})})(t$1.experimental||={})}(e.onnxruntime||={})},7448:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.OnnxjsSessionHandler=void 0;let r=n(1670),i=n(9162);e.OnnxjsSessionHandler=class{constructor(t$1){this.session=t$1,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(t$1,e$1,n$1){let o=new Map;for(let e$2 in t$1)if(Object.hasOwnProperty.call(t$1,e$2)){let n$2=t$1[e$2];o.set(e$2,new i.Tensor(n$2.dims,n$2.type,void 0,void 0,n$2.data))}let a=await this.session.run(o),s={};return a.forEach((t$2,e$2)=>{s[e$2]=new r.Tensor(t$2.type,t$2.data,t$2.dims)}),s}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.Session=void 0;let r=n(7067),i=n(1296),o=n(7091),a=n(1036),s=n(6231),u=n(2644);e.Session=class{constructor(t$1={}){this._initialized=!1,this.backendHint=t$1.backendHint,this.profiler=s.Profiler.create(t$1.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(t$1,e$1,n$1){await this.profiler.event(`session`,`Session.loadModel`,async()=>{let a$1=await(0,o.resolveBackend)(this.backendHint);if(this.sessionHandler=a$1.createSessionHandler(this.context),this._model=new u.Model,typeof t$1==`string`){let e$2=t$1.endsWith(`.ort`);if(typeof fetch>`u`){let n$2=await(0,i.promisify)(r.readFile)(t$1);this.initialize(n$2,e$2)}else{let n$2=await fetch(t$1),r$1=await n$2.arrayBuffer();this.initialize(new Uint8Array(r$1),e$2)}}else if(ArrayBuffer.isView(t$1))this.initialize(t$1);else{let r$1=new Uint8Array(t$1,e$1||0,n$1||t$1.byteLength);this.initialize(r$1)}})}initialize(t$1,e$1){if(this._initialized)throw Error(`already initialized`);this.profiler.event(`session`,`Session.initialize`,()=>{let n$1=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(t$1,n$1,e$1),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new a.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(t$1){if(!this._initialized)throw Error(`session not initialized yet`);return this.profiler.event(`session`,`Session.run`,async()=>{let e$1=this.normalizeAndValidateInputs(t$1),n$1=await this._executionPlan.execute(this.sessionHandler,e$1);return this.createOutput(n$1)})}normalizeAndValidateInputs(t$1){let e$1=this._model.graph.getInputNames();if(Array.isArray(t$1)){if(t$1.length!==e$1.length)throw Error(`incorrect input array length: expected ${e$1.length} but got ${t$1.length}`)}else{if(t$1.size!==e$1.length)throw Error(`incorrect input map size: expected ${e$1.length} but got ${t$1.size}`);let n$1=Array(t$1.size),r$1=0;for(let i$1=0;i$1typeof t$2==`string`)))throw TypeError(`cache should be a string array`);c$1&&(this.cache=Array(s$1))}else{if(o$1!==void 0){let t$2=f(e$1);if(!(o$1 instanceof t$2))throw TypeError(`cache should be type ${t$2.name}`)}if(c$1){let t$2=new ArrayBuffer(s$1*function(t$3){switch(t$3){case`bool`:case`int8`:case`uint8`:return 1;case`int16`:case`uint16`:return 2;case`int32`:case`uint32`:case`float32`:return 4;case`float64`:return 8;default:throw Error(`cannot calculate sizeof() on type ${t$3}`)}}(e$1));this.cache=function(t$3,e$2){return new(f(e$2))(t$3)}(t$2,e$1)}}}static fromProto(t$1){if(!t$1)throw Error(`cannot construct Value from an empty tensor`);let e$1=u.ProtoUtil.tensorDataTypeFromProto(t$1.dataType),n$1=u.ProtoUtil.tensorDimsFromProto(t$1.dims),r$1=new l(n$1,e$1);if(e$1===`string`)t$1.stringData.forEach((t$2,e$2)=>{r$1.data[e$2]=(0,u.decodeUtf8String)(t$2)});else if(t$1.rawData&&typeof t$1.rawData.byteLength==`number`&&t$1.rawData.byteLength>0){let e$2=r$1.data,n$2=new DataView(t$1.rawData.buffer,t$1.rawData.byteOffset,t$1.rawData.byteLength),i$1=p$1(t$1.dataType),o$1=t$1.rawData.byteLength/i$1;if(t$1.rawData.byteLength%i$1!=0)throw Error(`invalid buffer length`);if(e$2.length!==o$1)throw Error(`buffer length mismatch`);for(let r$2=0;r$20){let e$2=r$1.data,n$2=new DataView(t$1.rawDataArray().buffer,t$1.rawDataArray().byteOffset,t$1.rawDataLength()),i$1=p$1(t$1.dataType()),o$1=t$1.rawDataLength()/i$1;if(t$1.rawDataLength()%i$1!=0)throw Error(`invalid buffer length`);if(e$2.length!==o$1)throw Error(`buffer length mismatch`);for(let r$2=0;r$21&&u$1>1)return;a$1[o$1-s$1]=Math.max(n$2,u$1)}return a$1}static index(t$1,e$1){let n$1=Array(e$1.length);return c.fillIndex(t$1,e$1,n$1),n$1}static fillIndex(t$1,e$1,n$1){let r$1=t$1.length-e$1.length;for(let i$1=0;i$1=0;t$2--)r$2[t$2]=l$1%o$1[t$2],l$1=Math.floor(l$1/o$1[t$2]);d$1||(c.fillIndex(r$2,t$1.dims,i$2),p$2=t$1.get(i$2)),h$1||(c.fillIndex(r$2,e$1.dims,s$1),f$1=e$1.get(s$1)),u$1.set(r$2,n$1(p$2,f$1))}}return u$1}}static isValidBroadcast(t$1,e$1){let n$1=t$1.length,r$1=e$1.length;if(n$1>r$1)return!1;for(let i$1=1;i$1<=n$1;i$1++)if(t$1[n$1-i$1]!==1&&t$1[n$1-i$1]!==e$1[r$1-i$1])return!1;return!0}static getBroadcastDims(t$1,e$1){let n$1=t$1.length,r$1=[];for(let i$1=0;i$11&&a$1===1&&r$1.unshift(o$1)}return r$1}}e.BroadcastUtil=c,e.arrayCopyHelper=function(t$1,e$1,n$1,r$1,i$1){if(r$1<0||r$1>=e$1.length)throw Error(`sourceIndex out of bounds`);if(n$1<0||n$1>=t$1.length)throw Error(`targetIndex out of bounds`);if(r$1+i$1>e$1.length)throw Error(`source indices to be copied are outside bounds`);if(n$1+i$1>t$1.length)throw Error(`target array is too small to hold result`);for(let o$1=0;o$1o.default.isLong(t$2)?t$2.toNumber():t$2)}static tensorValueTypeFromProto(t$1){return{tensorType:l.tensorDataTypeFromProto(t$1.elemType),shape:{dims:l.tensorDimsFromProto(t$1.shape.dim.map(t$2=>t$2.dimValue))}}}static tensorDimsFromORTFormat(t$1){let e$1=[];for(let n$1=0;n$1t$1.length)throw Error(`invalid dimension of ${e$1} for sizeFromDimension as Tensor has ${t$1.length} dimensions.`);return f.getSizeFromDimensionRange(t$1,e$1,t$1.length)}static sizeToDimension(t$1,e$1){if(e$1<0||e$1>t$1.length)throw Error(`invalid dimension of ${e$1} for sizeToDimension as Tensor has ${t$1.length} dimensions.`);return f.getSizeFromDimensionRange(t$1,0,e$1)}static getSizeFromDimensionRange(t$1,e$1,n$1){let r$1=1;for(let i$1=e$1;i$1=0;--r$1)n$1[r$1]=n$1[r$1+1]*t$1[r$1+1];return n$1}static transpose(t$1){return t$1.slice().reverse()}static indicesToOffset(t$1,e$1,n$1){n$1===void 0&&(n$1=t$1.length);let r$1=0;for(let i$1=0;i$1=e$1)throw Error(`unsupported axis for this operation.`);return t$1<0?t$1+e$1:t$1}static normalizeAxes(t$1,e$1){return t$1.map(t$2=>this.normalizeAxis(t$2,e$1))}static incrementIndex(t$1,e$1,n$1){if(e$1.length===0||t$1.length===0)throw Error(`Index incrementing unsupported for scalar Tensor`);if(n$1===void 0)n$1=e$1.length;else if(n$1<=0||n$1>e$1.length)throw Error(`Incorrect axis to increment on`);for(let r$1=n$1-1;r$1>=0&&(t$1[r$1]++,!(t$1[r$1]=t$1.length)throw Error(`the dimension with value zero exceeds the dimension size of the input tensor`);r$1[a$2]=t$1[a$2]}else r$1[a$2]=e$1[a$2];o$1*=r$1[a$2]}}let a$1=f.size(t$1);if(i$1!==-1){if(a$1%o$1!=0)throw Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${t$1}] Output shape: [${e$1}]`);r$1[i$1]=a$1/o$1}else if(o$1!==a$1)throw Error(`reshapedDims and originalDims don't have matching sizes`);return r$1}static sortBasedOnPerm(t$1,e$1){return e$1?e$1.map(e$2=>t$1[e$2]):t$1.slice().reverse()}static padShape(t$1,e$1){let n$1=t$1.length;return t$1.map((t$2,r$1)=>t$2+e$1[r$1]+e$1[r$1+n$1])}static areEqual(t$1,e$1){return t$1.length===e$1.length&&t$1.every((t$2,n$1)=>t$2===e$1[n$1])}static validateDimsAndCalcSize(t$1){if(t$1.length>6)throw TypeError(`Only rank 0 to 6 is supported for tensor shape.`);let e$1=1;for(let n$1 of t$1){if(!Number.isInteger(n$1))throw TypeError(`Invalid shape: ${n$1} is not an integer`);if(n$1<0||n$1>2147483647)throw TypeError(`Invalid shape: length ${n$1} is not allowed`);e$1*=n$1}return e$1}static flattenShape(t$1,e$1){e$1<0&&(e$1+=t$1.length);let n$1=t$1.reduce((t$2,e$2)=>t$2*e$2,1),r$1=t$1.slice(e$1).reduce((t$2,e$2)=>t$2*e$2,1);return[n$1/r$1,r$1]}static squeezeShape(t$1,e$1){let n$1=[];e$1=f.normalizeAxes(e$1,t$1.length);for(let r$1=0;r$1=0;if(i$1&&t$1[r$1]!==1)throw Error(`squeeze an axis of size different than 1`);(e$1.length===0&&t$1[r$1]>1||e$1.length>0&&!i$1)&&n$1.push(t$1[r$1])}return n$1}static unsqueezeShape(t$1,e$1){let n$1=Array(t$1.length+e$1.length);n$1.fill(0);for(let t$2=0;t$2=n$1.length)throw Error(`'axes' has an out of range axis`);if(n$1[r$2]!==0)throw Error(`'axes' has a duplicate axis`);n$1[r$2]=1}let r$1=0;for(let e$2=0;e$2=e$1.length)throw Error(`sourceIndex out of bounds`);if(n$1<0||n$1>=t$1.length)throw Error(`targetIndex out of bounds`);if(r$1+i$1>e$1.length)throw Error(`source indices to be copied are outside bounds`);if(n$1+i$1>t$1.length)throw Error(`target array is too small to hold result`);for(let o$1=0;o$1=e$1.length)throw Error(`sourceIndex out of bounds`);if(n$1<0||n$1>=t$1.length)throw Error(`targetIndex out of bounds`);if(r$1+i$1>e$1.length)throw Error(`source indices to be copied are outside bounds`);if(n$1+i$1>t$1.length)throw Error(`target array is too small to hold result`);for(let a$1=0;a$1=e$1.length)throw Error(`sourceIndex out of bounds`);if(n$1<0||n$1>=t$1.length)throw Error(`targetIndex out of bounds`);if(r$1+i$1>e$1.length)throw Error(`source indices to be copied are outside bounds`);if(n$1+i$1>t$1.length)throw Error(`target array is too small to hold result`);for(let a$1=0;a$1=e$1.length)throw Error(`sourceIndex out of bounds`);if(n$1<0||n$1>=t$1.length)throw Error(`targetIndex out of bounds`);if(r$1+i$1>e$1.length)throw Error(`source indices to be copied are outside bounds`);if(n$1+i$1>t$1.length)throw Error(`target array is too small to hold result`);for(let o$1=0;o$1e$1.push(n$2));let a$1=h.calcReduceShape(o$1,e$1,!0),u$1=f.size(a$1),l$1=new s.Tensor(a$1,t$1.type),p$2=f.computeStrides(a$1),d$1=f.computeStrides(o$1),g$1=Array(o$1.length);for(let n$2=0;n$2=e$1.length)return o$1(t$1[i$1]);let u$1=e$1[r$1],c$1=u$1>=n$1.length?1:f.size(n$1.slice(u$1+1));for(let l$1=0;l$1t$2!==0)}}e.ReduceUtil=h;class g{static adjustPoolAttributes(t$1,e$1,n$1,r$1,i$1,o$1){if(!t$1&&n$1.length!==e$1.length-2)throw Error(`length of specified kernel shapes should be 2 less than length of input dimensions`);if(t$1)for(let t$2=0;t$2=n$1.length?n$1.push(e$1[t$2+2]):n$1[t$2]=e$1[t$2+2];for(let t$2=0;t$2=n$1[t$2]||o$1[t$2+n$1.length]>=n$1[t$2])throw Error(`pads should be smaller than kernel`)}}static adjustPadsBasedOnAutoPad(t$1,e$1,n$1,r$1,i$1,o$1){if(o$1){if(i$1.length!==2*(t$1.length-2))throw Error(`length of pads should be twice the length of data dimensions`);if(e$1.length!==t$1.length-2)throw Error(`length of strides should be the length of data dimensions`);if(r$1.length!==t$1.length-2)throw Error(`length of kernel shapes should be the length of data dimensions`);for(let a$1=0;a$1{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t$1,n,r,i)=>{if(typeof t$1==`object`&&t$1){if(r.has(t$1))throw Error(`Circular reference in options`);r.add(t$1)}Object.entries(t$1).forEach(([t$2,o])=>{let a=n?n+t$2:t$2;if(typeof o==`object`)(0,e.iterateExtraOptions)(o,a+`.`,r,i);else if(typeof o==`string`||typeof o==`number`)i(a,o.toString());else{if(typeof o!=`boolean`)throw Error(`Can't handle extra config type: `+typeof o);i(a,o?`1`:`0`)}})}},2157:function(t,e,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(t$1,e$1,n$1,r$1){r$1===void 0&&(r$1=n$1);var i$1=Object.getOwnPropertyDescriptor(e$1,n$1);i$1&&!(`get`in i$1?!e$1.__esModule:i$1.writable||i$1.configurable)||(i$1={enumerable:!0,get:function(){return e$1[n$1]}}),Object.defineProperty(t$1,r$1,i$1)}:function(t$1,e$1,n$1,r$1){r$1===void 0&&(r$1=n$1),t$1[r$1]=e$1[n$1]}),o=this&&this.__setModuleDefault||(Object.create?function(t$1,e$1){Object.defineProperty(t$1,`default`,{enumerable:!0,value:e$1})}:function(t$1,e$1){t$1.default=e$1}),a=this&&this.__importStar||function(t$1){if(t$1&&t$1.__esModule)return t$1;var e$1={};if(t$1!=null)for(var n$1 in t$1)n$1!==`default`&&Object.prototype.hasOwnProperty.call(t$1,n$1)&&i(e$1,t$1,n$1);return o(e$1,t$1),e$1};Object.defineProperty(e,`__esModule`,{value:!0}),e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=e.initWasm=void 0;let s=n(1670),u=a(n(349)),c=n(6361),l=()=>!!s.env.wasm.proxy&&typeof document<`u`,p$1,f,d,h=!1,g=!1,b=!1,m=[],y=[],_=[],v=[],w=[],x=[],T=()=>{if(h||!g||b||!p$1)throw Error(`worker not ready`)},S=t$1=>{switch(t$1.data.type){case`init-wasm`:h=!1,t$1.data.err?(b=!0,f[1](t$1.data.err)):(g=!0,f[0]());break;case`init-ort`:t$1.data.err?d[1](t$1.data.err):d[0]();break;case`create_allocate`:t$1.data.err?m.shift()[1](t$1.data.err):m.shift()[0](t$1.data.out);break;case`create_finalize`:t$1.data.err?y.shift()[1](t$1.data.err):y.shift()[0](t$1.data.out);break;case`create`:t$1.data.err?_.shift()[1](t$1.data.err):_.shift()[0](t$1.data.out);break;case`release`:t$1.data.err?v.shift()[1](t$1.data.err):v.shift()[0]();break;case`run`:t$1.data.err?w.shift()[1](t$1.data.err):w.shift()[0](t$1.data.out);break;case`end-profiling`:t$1.data.err?x.shift()[1](t$1.data.err):x.shift()[0]()}},O=typeof document<`u`?(r=document==null?void 0:document.currentScript)?.src:void 0;e.initWasm=async()=>{if(l()){if(g)return;if(h)throw Error(`multiple calls to 'initWasm()' detected.`);if(b)throw Error(`previous call to 'initWasm()' failed.`);return h=!0,s.env.wasm.wasmPaths===void 0&&O&&O.indexOf(`blob:`)!==0&&(s.env.wasm.wasmPaths=O.substr(0,+O.lastIndexOf(`/`)+1)),new Promise((t$1,e$1)=>{p$1?.terminate(),p$1=n(9710).Z(),p$1.onmessage=S,f=[t$1,e$1];let r$1={type:`init-wasm`,in:s.env.wasm};p$1.postMessage(r$1)})}return(0,c.initializeWebAssembly)(s.env.wasm)},e.initOrt=async(t$1,e$1)=>{if(l())return T(),new Promise((n$1,r$1)=>{d=[n$1,r$1];let i$1={type:`init-ort`,in:{numThreads:t$1,loggingLevel:e$1}};p$1.postMessage(i$1)});u.initOrt(t$1,e$1)},e.createSessionAllocate=async t$1=>l()?(T(),new Promise((e$1,n$1)=>{m.push([e$1,n$1]);let r$1={type:`create_allocate`,in:{model:t$1}};p$1.postMessage(r$1,[t$1.buffer])})):u.createSessionAllocate(t$1),e.createSessionFinalize=async(t$1,e$1)=>l()?(T(),new Promise((n$1,r$1)=>{y.push([n$1,r$1]);let i$1={type:`create_finalize`,in:{modeldata:t$1,options:e$1}};p$1.postMessage(i$1)})):u.createSessionFinalize(t$1,e$1),e.createSession=async(t$1,e$1)=>l()?(T(),new Promise((n$1,r$1)=>{_.push([n$1,r$1]);let i$1={type:`create`,in:{model:t$1,options:e$1}};p$1.postMessage(i$1,[t$1.buffer])})):u.createSession(t$1,e$1),e.releaseSession=async t$1=>{if(l())return T(),new Promise((e$1,n$1)=>{v.push([e$1,n$1]);let r$1={type:`release`,in:t$1};p$1.postMessage(r$1)});u.releaseSession(t$1)},e.run=async(t$1,e$1,n$1,r$1,i$1)=>l()?(T(),new Promise((o$1,a$1)=>{w.push([o$1,a$1]);let s$1={type:`run`,in:{sessionId:t$1,inputIndices:e$1,inputs:n$1,outputIndices:r$1,options:i$1}};p$1.postMessage(s$1,u.extractTransferableBuffers(n$1))})):u.run(t$1,e$1,n$1,r$1,i$1),e.endProfiling=async t$1=>{if(l())return T(),new Promise((e$1,n$1)=>{x.push([e$1,n$1]);let r$1={type:`end-profiling`,in:t$1};p$1.postMessage(r$1)});u.endProfiling(t$1)}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.setRunOptions=void 0;let r=n(7967),i=n(4983),o=n(6361);e.setRunOptions=t$1=>{let e$1=(0,o.getInstance)(),n$1=0,a=[],s=t$1||{};try{if(t$1?.logSeverityLevel===void 0)s.logSeverityLevel=2;else if(typeof t$1.logSeverityLevel!=`number`||!Number.isInteger(t$1.logSeverityLevel)||t$1.logSeverityLevel<0||t$1.logSeverityLevel>4)throw Error(`log serverity level is not valid: ${t$1.logSeverityLevel}`);if(t$1?.logVerbosityLevel===void 0)s.logVerbosityLevel=0;else if(typeof t$1.logVerbosityLevel!=`number`||!Number.isInteger(t$1.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${t$1.logVerbosityLevel}`);t$1?.terminate===void 0&&(s.terminate=!1);let o$1=0;if(t$1?.tag!==void 0&&(o$1=(0,i.allocWasmString)(t$1.tag,a)),n$1=e$1._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,o$1),n$1===0)throw Error(`Can't create run options`);return t$1?.extra!==void 0&&(0,r.iterateExtraOptions)(t$1.extra,``,new WeakSet,(t$2,r$1)=>{let o$2=(0,i.allocWasmString)(t$2,a),s$1=(0,i.allocWasmString)(r$1,a);if(e$1._OrtAddRunConfigEntry(n$1,o$2,s$1)!==0)throw Error(`Can't set a run config entry: ${t$2} - ${r$1}`)}),[n$1,a]}catch(t$2){throw n$1!==0&&e$1._OrtReleaseRunOptions(n$1),a.forEach(e$1._free),t$2}}},2306:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.OnnxruntimeWebAssemblySessionHandler=void 0;let r=n(2806),i=n(1670),o=n(2850),a=n(2157),s;e.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(t$1){let e$1=await fetch(t$1),n$1=await e$1.arrayBuffer();return(0,a.createSessionAllocate)(new Uint8Array(n$1))}async loadModel(t$1,e$1){if(s||(await(0,a.initOrt)(i.env.wasm.numThreads,(t$2=>{switch(t$2){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${t$2}`)}})(i.env.logLevel)),s=!0),typeof t$1==`string`)if(typeof fetch>`u`){let n$1=await(0,o.promisify)(r.readFile)(t$1);[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSession)(n$1,e$1)}else{let n$1=await this.createSessionAllocate(t$1);[this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSessionFinalize)(n$1,e$1)}else [this.sessionId,this.inputNames,this.outputNames]=await(0,a.createSession)(t$1,e$1)}async dispose(){return(0,a.releaseSession)(this.sessionId)}async run(t$1,e$1,n$1){let r$1=[],o$1=[];Object.entries(t$1).forEach(t$2=>{let e$2=t$2[0],n$2=t$2[1],i$1=this.inputNames.indexOf(e$2);if(i$1===-1)throw Error(`invalid input '${e$2}'`);r$1.push(n$2),o$1.push(i$1)});let s$1=[];Object.entries(e$1).forEach(t$2=>{let e$2=t$2[0],n$2=this.outputNames.indexOf(e$2);if(n$2===-1)throw Error(`invalid output '${e$2}'`);s$1.push(n$2)});let u=await(0,a.run)(this.sessionId,o$1,r$1.map(t$2=>[t$2.type,t$2.dims,t$2.data]),s$1,n$1),c={};for(let t$2=0;t$2{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.setSessionOptions=void 0;let r=n(7967),i=n(4983),o=n(6361);e.setSessionOptions=t$1=>{let e$1=(0,o.getInstance)(),n$1=0,a=[],s=t$1||{};(t$2=>{t$2.extra||={},t$2.extra.session||(t$2.extra.session={});let e$2=t$2.extra.session;e$2.use_ort_model_bytes_directly||=`1`})(s);try{t$1?.graphOptimizationLevel===void 0&&(s.graphOptimizationLevel=`all`);let u=(t$2=>{switch(t$2){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${t$2}`)}})(s.graphOptimizationLevel);t$1?.enableCpuMemArena===void 0&&(s.enableCpuMemArena=!0),t$1?.enableMemPattern===void 0&&(s.enableMemPattern=!0),t$1?.executionMode===void 0&&(s.executionMode=`sequential`);let c=(t$2=>{switch(t$2){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${t$2}`)}})(s.executionMode),l=0;if(t$1?.logId!==void 0&&(l=(0,i.allocWasmString)(t$1.logId,a)),t$1?.logSeverityLevel===void 0)s.logSeverityLevel=2;else if(typeof t$1.logSeverityLevel!=`number`||!Number.isInteger(t$1.logSeverityLevel)||t$1.logSeverityLevel<0||t$1.logSeverityLevel>4)throw Error(`log serverity level is not valid: ${t$1.logSeverityLevel}`);if(t$1?.logVerbosityLevel===void 0)s.logVerbosityLevel=0;else if(typeof t$1.logVerbosityLevel!=`number`||!Number.isInteger(t$1.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${t$1.logVerbosityLevel}`);if(t$1?.enableProfiling===void 0&&(s.enableProfiling=!1),n$1=e$1._OrtCreateSessionOptions(u,!!s.enableCpuMemArena,!!s.enableMemPattern,c,!!s.enableProfiling,0,l,s.logSeverityLevel,s.logVerbosityLevel),n$1===0)throw Error(`Can't create session options`);return t$1!=null&&t$1.executionProviders&&((t$2,e$2,n$2)=>{for(let r$1 of e$2){let e$3=typeof r$1==`string`?r$1:r$1.name;switch(e$3){case`xnnpack`:e$3=`XNNPACK`;break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported EP: ${e$3}`)}let a$1=(0,i.allocWasmString)(e$3,n$2);if((0,o.getInstance)()._OrtAppendExecutionProvider(t$2,a$1)!==0)throw Error(`Can't append execution provider: ${e$3}`)}})(n$1,t$1.executionProviders,a),t$1?.extra!==void 0&&(0,r.iterateExtraOptions)(t$1.extra,``,new WeakSet,(t$2,r$1)=>{let o$1=(0,i.allocWasmString)(t$2,a),s$1=(0,i.allocWasmString)(r$1,a);if(e$1._OrtAddSessionConfigEntry(n$1,o$1,s$1)!==0)throw Error(`Can't set a session config entry: ${t$2} - ${r$1}`)}),[n$1,a]}catch(t$2){throw n$1!==0&&e$1._OrtReleaseSessionOptions(n$1),a.forEach(e$1._free),t$2}}},4983:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.allocWasmString=void 0;let r=n(6361);e.allocWasmString=(t$1,e$1)=>{let n$1=(0,r.getInstance)(),i=n$1.lengthBytesUTF8(t$1)+1,o=n$1._malloc(i);return n$1.stringToUTF8(t$1,o,i),e$1.push(o),o}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;let r=n(586),i=n(4919),o=n(4983),a=n(6361);e.initOrt=(t$1,e$1)=>{let n$1=(0,a.getInstance)()._OrtInit(t$1,e$1);if(n$1!==0)throw Error(`Can't initialize onnxruntime. error code = ${n$1}`)};let s=new Map;e.createSessionAllocate=t$1=>{let e$1=(0,a.getInstance)(),n$1=e$1._malloc(t$1.byteLength);return e$1.HEAPU8.set(t$1,n$1),[n$1,t$1.byteLength]},e.createSessionFinalize=(t$1,e$1)=>{let n$1=(0,a.getInstance)(),r$1=0,o$1=0,u$1=[];try{if([o$1,u$1]=(0,i.setSessionOptions)(e$1),r$1=n$1._OrtCreateSession(t$1[0],t$1[1],o$1),r$1===0)throw Error(`Can't create a session`)}finally{n$1._free(t$1[0]),n$1._OrtReleaseSessionOptions(o$1),u$1.forEach(n$1._free)}let c$1=n$1._OrtGetInputCount(r$1),l$1=n$1._OrtGetOutputCount(r$1),p$1=[],f=[],d=[],h=[];for(let t$2=0;t$2{let r$1=(0,e.createSessionAllocate)(t$1);return(0,e.createSessionFinalize)(r$1,n$1)},e.releaseSession=t$1=>{let e$1=(0,a.getInstance)(),n$1=s.get(t$1);if(!n$1)throw Error(`invalid session id`);let r$1=n$1[0],i$1=n$1[1],o$1=n$1[2];i$1.forEach(e$1._OrtFree),o$1.forEach(e$1._OrtFree),e$1._OrtReleaseSession(r$1),s.delete(t$1)};let u=t$1=>{switch(t$1){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;default:throw Error(`unsupported data type: ${t$1}`)}},c=t$1=>{switch(t$1){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;default:throw Error(`unsupported data type: ${t$1}`)}},l=t$1=>{switch(t$1){case`float32`:return Float32Array;case`uint8`:case`bool`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${t$1}`)}};e.run=(t$1,e$1,n$1,i$1,p$1)=>{let f=(0,a.getInstance)(),d=s.get(t$1);if(!d)throw Error(`invalid session id`);let h=d[0],g=d[1],b=d[2],m=e$1.length,y=i$1.length,_=0,v=[],w=[],x=[];try{[_,v]=(0,r.setRunOptions)(p$1);for(let t$3=0;t$3f.HEAP32[t$4++]=e$3);let n$2=f._OrtCreateTensor(u(e$2),a$2,s$2,l$1,r$1.length);if(n$2===0)throw Error(`Can't create a tensor`);w.push(n$2)}finally{f.stackRestore(c$1)}}let t$2=f.stackSave(),a$1=f.stackAlloc(4*m),s$1=f.stackAlloc(4*m),d$1=f.stackAlloc(4*y),T=f.stackAlloc(4*y);try{let n$2=a$1/4,r$1=s$1/4,o$1=d$1/4,u$1=T/4;for(let t$3=0;t$3t$5*e$3);if(i$2=c(a$2),i$2===`string`){let t$5=[],e$3=o$2/4;for(let n$4=0;n$4{let e$1=(0,a.getInstance)(),n$1=s.get(t$1);if(!n$1)throw Error(`invalid session id`);let r$1=n$1[0],i$1=e$1._OrtEndProfiling(r$1);if(i$1===0)throw Error(`Can't get an profile file name`);e$1._OrtFree(i$1)},e.extractTransferableBuffers=t$1=>{let e$1=[];for(let n$1 of t$1){let t$2=n$1[2];!Array.isArray(t$2)&&t$2.buffer&&e$1.push(t$2.buffer)}return e$1}},6361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t$1,e$1,n$1,r$1){r$1===void 0&&(r$1=n$1);var i$1=Object.getOwnPropertyDescriptor(e$1,n$1);i$1&&!(`get`in i$1?!e$1.__esModule:i$1.writable||i$1.configurable)||(i$1={enumerable:!0,get:function(){return e$1[n$1]}}),Object.defineProperty(t$1,r$1,i$1)}:function(t$1,e$1,n$1,r$1){r$1===void 0&&(r$1=n$1),t$1[r$1]=e$1[n$1]}),i=this&&this.__setModuleDefault||(Object.create?function(t$1,e$1){Object.defineProperty(t$1,`default`,{enumerable:!0,value:e$1})}:function(t$1,e$1){t$1.default=e$1}),o=this&&this.__importStar||function(t$1){if(t$1&&t$1.__esModule)return t$1;var e$1={};if(t$1!=null)for(var n$1 in t$1)n$1!==`default`&&Object.prototype.hasOwnProperty.call(t$1,n$1)&&r(e$1,t$1,n$1);return i(e$1,t$1),e$1},a=this&&this.__importDefault||function(t$1){return t$1&&t$1.__esModule?t$1:{default:t$1}};Object.defineProperty(e,`__esModule`,{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;let s=o(n(6449)),u=a(n(932)),c=n(3474),l,p$1=!1,f=!1,d=!1,h=(t$1,e$1)=>e$1?t$1?`ort-wasm-simd-threaded.wasm`:`ort-wasm-threaded.wasm`:t$1?`ort-wasm-simd.wasm`:`ort-wasm.wasm`;e.initializeWebAssembly=async t$1=>{if(p$1)return Promise.resolve();if(f)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(d)throw Error(`previous call to 'initializeWebAssembly()' failed.`);f=!0;let e$1=t$1.initTimeout,r$1=t$1.numThreads,i$1=t$1.simd,o$1=r$1>1&&(()=>{try{return typeof SharedArrayBuffer<`u`&&(typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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])))}catch{return!1}})(),a$1=i$1&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}})(),g=typeof t$1.wasmPaths==`string`?t$1.wasmPaths:void 0,b=h(!1,o$1),m=h(a$1,o$1),y=typeof t$1.wasmPaths==`object`?t$1.wasmPaths[m]:void 0,_=!1,v=[];if(e$1>0&&v.push(new Promise(t$2=>{setTimeout(()=>{_=!0,t$2()},e$1)})),v.push(new Promise((t$2,e$2)=>{let r$2=o$1?c:u.default,i$2={locateFile:(t$3,e$3)=>o$1&&t$3.endsWith(`.worker.js`)&&typeof Blob<`u`?URL.createObjectURL(new Blob([n(4154)],{type:`text/javascript`})):t$3===b?y??(g??e$3)+m:e$3+t$3};if(o$1)if(typeof Blob>`u`)i$2.mainScriptUrlOrBlob=s.join(`/`,`ort-wasm-threaded.js`);else{let t$3=`var ortWasmThreaded=(function(){var _scriptDir;return ${r$2.toString()}})();`;i$2.mainScriptUrlOrBlob=new Blob([t$3],{type:`text/javascript`})}r$2(i$2).then(e$3=>{f=!1,p$1=!0,l=e$3,t$2()},t$3=>{f=!1,d=!0,e$2(t$3)})})),await Promise.race(v),_)throw Error(`WebAssembly backend initializing failed due to timeout: ${e$1}ms`)},e.getInstance=()=>{if(p$1&&l)return l;throw Error(`WebAssembly is not initialized yet.`)},e.dispose=()=>{var t$1;!p$1||f||d||(f=!0,(t$1=l.PThread)==null||t$1.terminateAllThreads(),l=void 0,f=!1,p$1=!1,d=!0)}},9710:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(477),i=n.n(r);function o(){return i()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;tt*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',`Worker`,void 0,void 0)}},477:t=>{"use strict";t.exports=function(t$1,e,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([t$1])}catch{(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(t$1),o=o.getBlob()}var a=i.URL||i.webkitURL,s=a.createObjectURL(o),u=new i[e](s,n);return a.revokeObjectURL(s),u}catch{return new i[e](`data:application/javascript,${encodeURIComponent(t$1)}`,n)}}catch{if(!r)throw Error(`Inline worker is not supported`);return new i[e](r,n)}}},4154:t=>{"use strict";t.exports=`"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}}; -`},1670:t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(t,e,n)=>{"use strict";n.r(e),n.d(e,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,r.Long=function(t$1,e$1){this.low=0|t$1,this.high=0|e$1},r.Long.create=function(t$1,e$1){return t$1==0&&e$1==0?r.Long.ZERO:new r.Long(t$1,e$1)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t$1){return this.low==t$1.low&&this.high==t$1.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t$1){if(t$1)e$1=t$1;else var e$1=1024;this.bb=r.ByteBuffer.allocate(e$1),this.space=e$1,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t$1){this.force_defaults=t$1},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t$1,e$1){t$1>this.minalign&&(this.minalign=t$1);for(var n$1=1+~(this.bb.capacity()-this.space+e$1)&t$1-1;this.space=0&&this.vtable[e$1]==0;e$1--);for(var n$1=e$1+1;e$1>=0;e$1--)this.addInt16(this.vtable[e$1]==0?0:t$1-this.vtable[e$1]);this.addInt16(t$1-this.object_start);var i=(n$1+2)*r.SIZEOF_SHORT;this.addInt16(i);var o=0,a=this.space;t:for(e$1=0;e$1=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,r.SIZEOF_INT+i),this.addOffset(t$1),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t$1,e$1){this.finish(t$1,e$1,!0)},r.Builder.prototype.requiredField=function(t$1,e$1){var n$1=this.bb.capacity()-t$1,r$1=n$1-this.bb.readInt32(n$1);if(this.bb.readInt16(r$1+e$1)==0)throw Error(`FlatBuffers: field `+e$1+` must be set`)},r.Builder.prototype.startVector=function(t$1,e$1,n$1){this.notNested(),this.vector_num_elems=e$1,this.prep(r.SIZEOF_INT,t$1*e$1),this.prep(n$1,t$1*e$1)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t$1){if(t$1 instanceof Uint8Array)var e$1=t$1;else{e$1=[];for(var n$1=0;n$1=56320?i:(i<<10)+t$1.charCodeAt(n$1++)+-56613888)<128?e$1.push(r$1):(r$1<2048?e$1.push(r$1>>6&31|192):(r$1<65536?e$1.push(r$1>>12&15|224):e$1.push(r$1>>18&7|240,r$1>>12&63|128),e$1.push(r$1>>6&63|128)),e$1.push(63&r$1|128))}}this.addInt8(0),this.startVector(1,e$1.length,1),this.bb.setPosition(this.space-=e$1.length),n$1=0;for(var o=this.space,a=this.bb.bytes();n$1>24},r.ByteBuffer.prototype.readUint8=function(t$1){return this.bytes_[t$1]},r.ByteBuffer.prototype.readInt16=function(t$1){return this.readUint16(t$1)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t$1){return this.bytes_[t$1]|this.bytes_[t$1+1]<<8},r.ByteBuffer.prototype.readInt32=function(t$1){return this.bytes_[t$1]|this.bytes_[t$1+1]<<8|this.bytes_[t$1+2]<<16|this.bytes_[t$1+3]<<24},r.ByteBuffer.prototype.readUint32=function(t$1){return this.readInt32(t$1)>>>0},r.ByteBuffer.prototype.readInt64=function(t$1){return new r.Long(this.readInt32(t$1),this.readInt32(t$1+4))},r.ByteBuffer.prototype.readUint64=function(t$1){return new r.Long(this.readUint32(t$1),this.readUint32(t$1+4))},r.ByteBuffer.prototype.readFloat32=function(t$1){return r.int32[0]=this.readInt32(t$1),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t$1){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t$1),r.int32[r.isLittleEndian?1:0]=this.readInt32(t$1+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t$1,e$1){this.bytes_[t$1]=e$1},r.ByteBuffer.prototype.writeUint8=function(t$1,e$1){this.bytes_[t$1]=e$1},r.ByteBuffer.prototype.writeInt16=function(t$1,e$1){this.bytes_[t$1]=e$1,this.bytes_[t$1+1]=e$1>>8},r.ByteBuffer.prototype.writeUint16=function(t$1,e$1){this.bytes_[t$1]=e$1,this.bytes_[t$1+1]=e$1>>8},r.ByteBuffer.prototype.writeInt32=function(t$1,e$1){this.bytes_[t$1]=e$1,this.bytes_[t$1+1]=e$1>>8,this.bytes_[t$1+2]=e$1>>16,this.bytes_[t$1+3]=e$1>>24},r.ByteBuffer.prototype.writeUint32=function(t$1,e$1){this.bytes_[t$1]=e$1,this.bytes_[t$1+1]=e$1>>8,this.bytes_[t$1+2]=e$1>>16,this.bytes_[t$1+3]=e$1>>24},r.ByteBuffer.prototype.writeInt64=function(t$1,e$1){this.writeInt32(t$1,e$1.low),this.writeInt32(t$1+4,e$1.high)},r.ByteBuffer.prototype.writeUint64=function(t$1,e$1){this.writeUint32(t$1,e$1.low),this.writeUint32(t$1+4,e$1.high)},r.ByteBuffer.prototype.writeFloat32=function(t$1,e$1){r.float32[0]=e$1,this.writeInt32(t$1,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t$1,e$1){r.float64[0]=e$1,this.writeInt32(t$1,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t$1+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a)))}return i},r.ByteBuffer.prototype.__indirect=function(t$1){return t$1+this.readInt32(t$1)},r.ByteBuffer.prototype.__vector=function(t$1){return t$1+this.readInt32(t$1)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t$1){return this.readInt32(t$1+this.readInt32(t$1))},r.ByteBuffer.prototype.__has_identifier=function(t$1){if(t$1.length!=r.FILE_IDENTIFIER_LENGTH)throw Error(`FlatBuffers: file identifier must be length `+r.FILE_IDENTIFIER_LENGTH);for(var e$1=0;e$1{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(t,`__esModule`,{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})())}),require_common=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0})}),require_legacy=__commonJSMin(exports=>{var _a$1;Object.defineProperty(exports,`__esModule`,{value:!0}),exports.SileroLegacy=void 0;let logging_1$3=require_logging();var SileroLegacy=class{constructor(ortInstance$2,_session,_h,_c,_sr){this.ortInstance=ortInstance$2,this._session=_session,this._h=_h,this._c=_c,this._sr=_sr,this.reset_state=()=>{let zeroes=Array(2*64).fill(0);this._h=new this.ortInstance.Tensor(`float32`,zeroes,[2,1,64]),this._c=new this.ortInstance.Tensor(`float32`,zeroes,[2,1,64])},this.process=async audioFrame=>{var _out$output;let t=new this.ortInstance.Tensor(`float32`,audioFrame,[1,audioFrame.length]),inputs={input:t,h:this._h,c:this._c,sr:this._sr},out=await this._session.run(inputs);this._h=out.hn,this._c=out.cn;let[isSpeech]=(_out$output=out.output)?.data,notSpeech=1-isSpeech;return{notSpeech,isSpeech}}}};exports.SileroLegacy=SileroLegacy,_a$1=SileroLegacy,SileroLegacy.new=async(ortInstance$2,modelFetcher)=>{logging_1$3.log.debug(`initializing vad`);let modelArrayBuffer=await modelFetcher(),_session=await ortInstance$2.InferenceSession.create(modelArrayBuffer),_sr=new ortInstance$2.Tensor(`int64`,[16000n]),zeroes=Array(2*64).fill(0),_h=new ortInstance$2.Tensor(`float32`,zeroes,[2,1,64]),_c=new ortInstance$2.Tensor(`float32`,zeroes,[2,1,64]);logging_1$3.log.debug(`vad is initialized`);let model=new _a$1(ortInstance$2,_session,_h,_c,_sr);return model}}),require_v5=__commonJSMin(exports=>{var _a;Object.defineProperty(exports,`__esModule`,{value:!0}),exports.SileroV5=void 0;let logging_1$2=require_logging();function getNewState(ortInstance$2){let zeroes=Array(2*128).fill(0);return new ortInstance$2.Tensor(`float32`,zeroes,[2,1,128])}var SileroV5=class{constructor(_session,_state,_sr,ortInstance$2){this._session=_session,this._state=_state,this._sr=_sr,this.ortInstance=ortInstance$2,this.reset_state=()=>{this._state=getNewState(this.ortInstance)},this.process=async audioFrame=>{var _out$output2;let t=new this.ortInstance.Tensor(`float32`,audioFrame,[1,audioFrame.length]),inputs={input:t,state:this._state,sr:this._sr},out=await this._session.run(inputs);this._state=out.stateN;let[isSpeech]=(_out$output2=out.output)?.data,notSpeech=1-isSpeech;return{notSpeech,isSpeech}}}};exports.SileroV5=SileroV5,_a=SileroV5,SileroV5.new=async(ortInstance$2,modelFetcher)=>{logging_1$2.log.debug(`Loading VAD...`);let modelArrayBuffer=await modelFetcher(),_session=await ortInstance$2.InferenceSession.create(modelArrayBuffer),_sr=new ortInstance$2.Tensor(`int64`,[16000n]),_state=getNewState(ortInstance$2);return logging_1$2.log.debug(`...finished loading VAD`),new _a(_session,_state,_sr,ortInstance$2)}}),require_models=__commonJSMin(exports=>{var __createBinding$2=Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||(`get`in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__exportStar=function(m,exports$1){for(var p$1 in m)p$1!==`default`&&!Object.prototype.hasOwnProperty.call(exports$1,p$1)&&__createBinding$2(exports$1,m,p$1)};Object.defineProperty(exports,`__esModule`,{value:!0}),exports.SileroV5=exports.SileroLegacy=void 0,__exportStar(require_common(),exports);var legacy_1=require_legacy();Object.defineProperty(exports,`SileroLegacy`,{enumerable:!0,get:function(){return legacy_1.SileroLegacy}});var v5_1=require_v5();Object.defineProperty(exports,`SileroV5`,{enumerable:!0,get:function(){return v5_1.SileroV5}})}),require_resampler=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Resampler=void 0;let logging_1$1=require_logging();var Resampler=class{constructor(options){this.options=options,this.process=audioFrame=>{let outputFrames=[];for(let sample of audioFrame)for(this.inputBuffer.push(sample);this.hasEnoughDataForFrame();){let outputFrame=this.generateOutputFrame();outputFrames.push(outputFrame)}return outputFrames},options.nativeSampleRate<16e3&&logging_1$1.log.error(`nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate`),this.inputBuffer=[]}async*stream(audioInput){for(let sample of audioInput)for(this.inputBuffer.push(sample);this.hasEnoughDataForFrame();){let outputFrame=this.generateOutputFrame();yield outputFrame}}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){let outputFrame=new Float32Array(this.options.targetFrameSize),outputIndex=0,inputIndex=0;for(;outputIndex{var __createBinding$1=Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||(`get`in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__setModuleDefault$1=Object.create?function(o,v){Object.defineProperty(o,`default`,{enumerable:!0,value:v})}:function(o,v){o.default=v},__importStar$1=function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!==`default`&&Object.prototype.hasOwnProperty.call(mod,k)&&__createBinding$1(result,mod,k);return __setModuleDefault$1(result,mod),result};Object.defineProperty(exports,`__esModule`,{value:!0}),exports.NonRealTimeVAD=exports.defaultNonRealTimeVADOptions=void 0;let ortInstance$1=__importStar$1(require_ort_web_min()),asset_path_1$1=require_asset_path(),default_model_fetcher_1$2=require_default_model_fetcher(),frame_processor_1$2=require_frame_processor(),messages_1$2=require_messages(),models_1$1=require_models(),resampler_1$1=require_resampler();exports.defaultNonRealTimeVADOptions={...frame_processor_1$2.defaultLegacyFrameProcessorOptions,ortConfig:void 0,modelURL:asset_path_1$1.baseAssetPath+`silero_vad_legacy.onnx`,modelFetcher:default_model_fetcher_1$2.defaultModelFetcher};var NonRealTimeVAD=class{static async new(options={}){let fullOptions={...exports.defaultNonRealTimeVADOptions,...options};(0,frame_processor_1$2.validateOptions)(fullOptions),fullOptions.ortConfig!==void 0&&fullOptions.ortConfig(ortInstance$1);let modelFetcher=()=>fullOptions.modelFetcher(fullOptions.modelURL),model=await models_1$1.SileroLegacy.new(ortInstance$1,modelFetcher),frameProcessor=new frame_processor_1$2.FrameProcessor(model.process,model.reset_state,{frameSamples:fullOptions.frameSamples,positiveSpeechThreshold:fullOptions.positiveSpeechThreshold,negativeSpeechThreshold:fullOptions.negativeSpeechThreshold,redemptionFrames:fullOptions.redemptionFrames,preSpeechPadFrames:fullOptions.preSpeechPadFrames,minSpeechFrames:fullOptions.minSpeechFrames,submitUserSpeechOnPause:fullOptions.submitUserSpeechOnPause});frameProcessor.resume();let vad=new this(modelFetcher,ortInstance$1,fullOptions,frameProcessor);return vad}constructor(modelFetcher,ort,options,frameProcessor){this.modelFetcher=modelFetcher,this.ort=ort,this.options=options,this.frameProcessor=frameProcessor}async*run(inputAudio,sampleRate){let resamplerOptions={nativeSampleRate:sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},resampler=new resampler_1$1.Resampler(resamplerOptions),start=0,end=0,frameIndex=0,messageContainer=[];for await(let frame of resampler.stream(inputAudio)){await this.frameProcessor.process(frame,event=>{messageContainer.push(event)});for(let event of messageContainer)switch(event.msg){case messages_1$2.Message.SpeechStart:start=frameIndex*this.options.frameSamples/16;break;case messages_1$2.Message.SpeechEnd:end=(frameIndex+1)*this.options.frameSamples/16,yield{audio:event.audio,start,end};break;default:break}frameIndex++}let{msg,audio}=this.frameProcessor.endSegment(event=>{messageContainer.push(event)});for(let event of messageContainer)switch(event.msg){case messages_1$2.Message.SpeechEnd:yield{audio:event.audio,start,end:frameIndex*this.options.frameSamples/16}}}};exports.NonRealTimeVAD=NonRealTimeVAD}),require_utils=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.audioFileToArray=exports.encodeWAV=exports.arrayBufferToBase64=exports.minFramesForTargetMS=void 0;function minFramesForTargetMS(targetDuration,frameSamples,sr=16e3){return Math.ceil(targetDuration*sr/1e3/frameSamples)}exports.minFramesForTargetMS=minFramesForTargetMS;function arrayBufferToBase64(buffer){let bytes=new Uint8Array(buffer),len=bytes.byteLength,binary=Array(len);for(var i=0;i{reader.addEventListener(`loadend`,ev=>{let audioData=reader.result;ctx.decodeAudioData(audioData,buffer=>{audioBuffer=buffer,ctx.startRendering().then(renderedBuffer=>{console.log(`Rendering completed successfully`),res()}).catch(err=>{console.error(`Rendering failed: ${err}`)})},e=>{console.log(`Error with decoding audio data: ${e}`)})}),reader.readAsArrayBuffer(audioFileData)}),audioBuffer===null)throw Error(`some shit`);let _audioBuffer=audioBuffer,out=new Float32Array(_audioBuffer.length);for(let i=0;i<_audioBuffer.length;i++)for(let j=0;j<_audioBuffer.numberOfChannels;j++)out[i]+=_audioBuffer.getChannelData(j)[i];return{audio:out,sampleRate:_audioBuffer.sampleRate}}exports.audioFileToArray=audioFileToArray}),require_real_time_vad=__commonJSMin(exports=>{var __createBinding=Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||(`get`in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__setModuleDefault=Object.create?function(o,v){Object.defineProperty(o,`default`,{enumerable:!0,value:v})}:function(o,v){o.default=v},__importStar=function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!==`default`&&Object.prototype.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,`__esModule`,{value:!0}),exports.AudioNodeVAD=exports.MicVAD=exports.getDefaultRealTimeVADOptions=exports.ort=exports.DEFAULT_MODEL=void 0;let ortInstance=__importStar(require_ort_web_min()),default_model_fetcher_1$1=require_default_model_fetcher(),frame_processor_1$1=require_frame_processor(),logging_1=require_logging(),messages_1$1=require_messages(),models_1=require_models(),resampler_1=require_resampler();exports.DEFAULT_MODEL=`legacy`,exports.ort=ortInstance;let workletFile=`vad.worklet.bundle.min.js`,sileroV5File=`silero_vad_v5.onnx`,sileroLegacyFile=`silero_vad_legacy.onnx`,getDefaultRealTimeVADOptions$1=model=>{let frameProcessorOptions=model===`v5`?frame_processor_1$1.defaultV5FrameProcessorOptions:frame_processor_1$1.defaultLegacyFrameProcessorOptions;return{...frameProcessorOptions,onFrameProcessed:(probabilities,frame)=>{},onVADMisfire:()=>{logging_1.log.debug(`VAD misfire`)},onSpeechStart:()=>{logging_1.log.debug(`Detected speech start`)},onSpeechEnd:()=>{logging_1.log.debug(`Detected speech end`)},onSpeechRealStart:()=>{logging_1.log.debug(`Detected real speech start`)},baseAssetPath:`https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@latest/dist/`,onnxWASMBasePath:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/`,stream:void 0,ortConfig:void 0,model,workletOptions:{}}};exports.getDefaultRealTimeVADOptions=getDefaultRealTimeVADOptions$1;var MicVAD$1=class MicVAD$1{static async new(options={}){let fullOptions={...(0,exports.getDefaultRealTimeVADOptions)(options.model??exports.DEFAULT_MODEL),...options};(0,frame_processor_1$1.validateOptions)(fullOptions);let stream;stream=fullOptions.stream===void 0?await navigator.mediaDevices.getUserMedia({audio:{...fullOptions.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):fullOptions.stream;let audioContext=new AudioContext,sourceNode=new MediaStreamAudioSourceNode(audioContext,{mediaStream:stream}),audioNodeVAD=await AudioNodeVAD.new(audioContext,fullOptions);return audioNodeVAD.receive(sourceNode),new MicVAD$1(fullOptions,audioContext,stream,audioNodeVAD,sourceNode)}constructor(options,audioContext,stream,audioNodeVAD,sourceNode,listening=!1){this.options=options,this.audioContext=audioContext,this.stream=stream,this.audioNodeVAD=audioNodeVAD,this.sourceNode=sourceNode,this.listening=listening,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),this.options.stream===void 0&&this.stream.getTracks().forEach(track=>track.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()},this.setOptions=options$1=>{this.audioNodeVAD.setFrameProcessorOptions(options$1)}}};exports.MicVAD=MicVAD$1;var AudioNodeVAD=class AudioNodeVAD{static async new(ctx,options={}){let fullOptions={...(0,exports.getDefaultRealTimeVADOptions)(options.model??exports.DEFAULT_MODEL),...options};(0,frame_processor_1$1.validateOptions)(fullOptions),exports.ort.env.wasm.wasmPaths=fullOptions.onnxWASMBasePath,fullOptions.ortConfig!==void 0&&fullOptions.ortConfig(exports.ort);let modelFile=fullOptions.model===`v5`?sileroV5File:sileroLegacyFile,modelURL=fullOptions.baseAssetPath+modelFile,modelFactory=fullOptions.model===`v5`?models_1.SileroV5.new:models_1.SileroLegacy.new,model;try{model=await modelFactory(exports.ort,()=>(0,default_model_fetcher_1$1.defaultModelFetcher)(modelURL))}catch(e){throw console.error(`Encountered an error while loading model file ${modelURL}`),e}let frameProcessor=new frame_processor_1$1.FrameProcessor(model.process,model.reset_state,{frameSamples:fullOptions.frameSamples,positiveSpeechThreshold:fullOptions.positiveSpeechThreshold,negativeSpeechThreshold:fullOptions.negativeSpeechThreshold,redemptionFrames:fullOptions.redemptionFrames,preSpeechPadFrames:fullOptions.preSpeechPadFrames,minSpeechFrames:fullOptions.minSpeechFrames,submitUserSpeechOnPause:fullOptions.submitUserSpeechOnPause}),audioNodeVAD=new AudioNodeVAD(ctx,fullOptions,frameProcessor);return await audioNodeVAD.setupAudioNode(),audioNodeVAD}constructor(ctx,options,frameProcessor){this.ctx=ctx,this.options=options,this.bufferIndex=0,this.pause=()=>{this.frameProcessor.pause(this.handleFrameProcessorEvent)},this.start=()=>{this.frameProcessor.resume()},this.receive=node$1=>{node$1.connect(this.audioNode)},this.processFrame=async frame=>{await this.frameProcessor.process(frame,this.handleFrameProcessorEvent)},this.handleFrameProcessorEvent=ev=>{switch(ev.msg){case messages_1$1.Message.FrameProcessed:this.options.onFrameProcessed(ev.probs,ev.frame);break;case messages_1$1.Message.SpeechStart:this.options.onSpeechStart();break;case messages_1$1.Message.SpeechRealStart:this.options.onSpeechRealStart();break;case messages_1$1.Message.VADMisfire:this.options.onVADMisfire();break;case messages_1$1.Message.SpeechEnd:this.options.onSpeechEnd(ev.audio);break}},this.destroy=()=>{var _this$gainNode;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:messages_1$1.Message.SpeechStop}),this.audioNode.disconnect(),(_this$gainNode=this.gainNode)?.disconnect()},this.setFrameProcessorOptions=options$1=>{this.frameProcessor.options={...this.frameProcessor.options,...options$1}},this.frameProcessor=frameProcessor}async setupAudioNode(){let hasAudioWorklet=`audioWorklet`in this.ctx&&typeof AudioWorkletNode==`function`;if(hasAudioWorklet)try{let workletURL=this.options.baseAssetPath+workletFile;await this.ctx.audioWorklet.addModule(workletURL);let workletOptions=this.options.workletOptions??{};workletOptions.processorOptions={...workletOptions.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,`vad-helper-worklet`,workletOptions),this.audioNode.port.onmessage=async ev=>{var _ev$data;switch((_ev$data=ev.data)?.message){case messages_1$1.Message.AudioFrame:let buffer=ev.data.data;buffer instanceof ArrayBuffer||(buffer=new ArrayBuffer(ev.data.data.byteLength),new Uint8Array(buffer).set(new Uint8Array(ev.data.data)));let frame=new Float32Array(buffer);await this.processFrame(frame);break}};return}catch(e){console.log(`AudioWorklet setup failed, falling back to ScriptProcessor`,e)}this.resampler=new resampler_1.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});let bufferSize=4096;this.audioNode=this.ctx.createScriptProcessor(bufferSize,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let processingAudio=!1;this.audioNode.onaudioprocess=async e=>{if(!processingAudio){processingAudio=!0;try{let input=e.inputBuffer.getChannelData(0),output=e.outputBuffer.getChannelData(0);if(output.fill(0),this.resampler){let frames=this.resampler.process(input);for(let frame of frames)await this.processFrame(frame)}}catch(error){console.error(`Error processing audio:`,error)}finally{processingAudio=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}};exports.AudioNodeVAD=AudioNodeVAD}),require_dist=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.getDefaultRealTimeVADOptions=exports.MicVAD=exports.DEFAULT_MODEL=exports.AudioNodeVAD=exports.utils=exports.NonRealTimeVAD=exports.Message=exports.FrameProcessor=exports.defaultModelFetcher=exports.baseAssetPath=void 0;var asset_path_1=require_asset_path();Object.defineProperty(exports,`baseAssetPath`,{enumerable:!0,get:function(){return asset_path_1.baseAssetPath}});var default_model_fetcher_1=require_default_model_fetcher();Object.defineProperty(exports,`defaultModelFetcher`,{enumerable:!0,get:function(){return default_model_fetcher_1.defaultModelFetcher}});var frame_processor_1=require_frame_processor();Object.defineProperty(exports,`FrameProcessor`,{enumerable:!0,get:function(){return frame_processor_1.FrameProcessor}});var messages_1=require_messages();Object.defineProperty(exports,`Message`,{enumerable:!0,get:function(){return messages_1.Message}});var non_real_time_vad_1=require_non_real_time_vad();Object.defineProperty(exports,`NonRealTimeVAD`,{enumerable:!0,get:function(){return non_real_time_vad_1.NonRealTimeVAD}});let utils_1=require_utils();exports.utils={audioFileToArray:utils_1.audioFileToArray,minFramesForTargetMS:utils_1.minFramesForTargetMS,arrayBufferToBase64:utils_1.arrayBufferToBase64,encodeWAV:utils_1.encodeWAV};var real_time_vad_1=require_real_time_vad();Object.defineProperty(exports,`AudioNodeVAD`,{enumerable:!0,get:function(){return real_time_vad_1.AudioNodeVAD}}),Object.defineProperty(exports,`DEFAULT_MODEL`,{enumerable:!0,get:function(){return real_time_vad_1.DEFAULT_MODEL}}),Object.defineProperty(exports,`MicVAD`,{enumerable:!0,get:function(){return real_time_vad_1.MicVAD}}),Object.defineProperty(exports,`getDefaultRealTimeVADOptions`,{enumerable:!0,get:function(){return real_time_vad_1.getDefaultRealTimeVADOptions}})}),import_dist=__toESM(require_dist());function useMicVAD(deviceId,options){let opts=defu(options??{},{...(0,import_dist.getDefaultRealTimeVADOptions)(`v5`),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),micVad=ref(),microphoneAccess=usePermission(`microphone`);async function update(){if(micVad.value&&(micVad.value.destroy(),micVad.value=void 0,console.warn(`existing MicVAD destroyed`)),!microphoneAccess.value)return;let id=unref(deviceId);if(!id)return;let media=await navigator.mediaDevices.getUserMedia({audio:{deviceId:id}});micVad.value=await import_dist.MicVAD.new({...opts,stream:media}),opts.auto&&micVad.value.start()}return watch(microphoneAccess,update,{immediate:!0}),watch(toRef(deviceId),update,{immediate:!0}),tryOnMounted(update),onUnmounted(()=>{micVad.value&&(micVad.value.destroy(),micVad.value=void 0)}),{destroy:()=>{micVad.value&&(micVad.value.destroy(),micVad.value=void 0)},start:()=>{micVad.value&&micVad.value.start()}}} +`},1670:t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(t,e,n)=>{"use strict";n.r(e),n.d(e,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,r.Long=function(t$1,e$1){this.low=0|t$1,this.high=0|e$1},r.Long.create=function(t$1,e$1){return t$1==0&&e$1==0?r.Long.ZERO:new r.Long(t$1,e$1)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t$1){return this.low==t$1.low&&this.high==t$1.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t$1){if(t$1)e$1=t$1;else var e$1=1024;this.bb=r.ByteBuffer.allocate(e$1),this.space=e$1,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t$1){this.force_defaults=t$1},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t$1,e$1){t$1>this.minalign&&(this.minalign=t$1);for(var n$1=1+~(this.bb.capacity()-this.space+e$1)&t$1-1;this.space=0&&this.vtable[e$1]==0;e$1--);for(var n$1=e$1+1;e$1>=0;e$1--)this.addInt16(this.vtable[e$1]==0?0:t$1-this.vtable[e$1]);this.addInt16(t$1-this.object_start);var i=(n$1+2)*r.SIZEOF_SHORT;this.addInt16(i);var o=0,a=this.space;t:for(e$1=0;e$1=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,r.SIZEOF_INT+i),this.addOffset(t$1),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t$1,e$1){this.finish(t$1,e$1,!0)},r.Builder.prototype.requiredField=function(t$1,e$1){var n$1=this.bb.capacity()-t$1,r$1=n$1-this.bb.readInt32(n$1);if(this.bb.readInt16(r$1+e$1)==0)throw Error(`FlatBuffers: field `+e$1+` must be set`)},r.Builder.prototype.startVector=function(t$1,e$1,n$1){this.notNested(),this.vector_num_elems=e$1,this.prep(r.SIZEOF_INT,t$1*e$1),this.prep(n$1,t$1*e$1)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t$1){if(t$1 instanceof Uint8Array)var e$1=t$1;else{e$1=[];for(var n$1=0;n$1=56320?i:(i<<10)+t$1.charCodeAt(n$1++)+-56613888)<128?e$1.push(r$1):(r$1<2048?e$1.push(r$1>>6&31|192):(r$1<65536?e$1.push(r$1>>12&15|224):e$1.push(r$1>>18&7|240,r$1>>12&63|128),e$1.push(r$1>>6&63|128)),e$1.push(63&r$1|128))}}this.addInt8(0),this.startVector(1,e$1.length,1),this.bb.setPosition(this.space-=e$1.length),n$1=0;for(var o=this.space,a=this.bb.bytes();n$1>24},r.ByteBuffer.prototype.readUint8=function(t$1){return this.bytes_[t$1]},r.ByteBuffer.prototype.readInt16=function(t$1){return this.readUint16(t$1)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t$1){return this.bytes_[t$1]|this.bytes_[t$1+1]<<8},r.ByteBuffer.prototype.readInt32=function(t$1){return this.bytes_[t$1]|this.bytes_[t$1+1]<<8|this.bytes_[t$1+2]<<16|this.bytes_[t$1+3]<<24},r.ByteBuffer.prototype.readUint32=function(t$1){return this.readInt32(t$1)>>>0},r.ByteBuffer.prototype.readInt64=function(t$1){return new r.Long(this.readInt32(t$1),this.readInt32(t$1+4))},r.ByteBuffer.prototype.readUint64=function(t$1){return new r.Long(this.readUint32(t$1),this.readUint32(t$1+4))},r.ByteBuffer.prototype.readFloat32=function(t$1){return r.int32[0]=this.readInt32(t$1),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t$1){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t$1),r.int32[r.isLittleEndian?1:0]=this.readInt32(t$1+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t$1,e$1){this.bytes_[t$1]=e$1},r.ByteBuffer.prototype.writeUint8=function(t$1,e$1){this.bytes_[t$1]=e$1},r.ByteBuffer.prototype.writeInt16=function(t$1,e$1){this.bytes_[t$1]=e$1,this.bytes_[t$1+1]=e$1>>8},r.ByteBuffer.prototype.writeUint16=function(t$1,e$1){this.bytes_[t$1]=e$1,this.bytes_[t$1+1]=e$1>>8},r.ByteBuffer.prototype.writeInt32=function(t$1,e$1){this.bytes_[t$1]=e$1,this.bytes_[t$1+1]=e$1>>8,this.bytes_[t$1+2]=e$1>>16,this.bytes_[t$1+3]=e$1>>24},r.ByteBuffer.prototype.writeUint32=function(t$1,e$1){this.bytes_[t$1]=e$1,this.bytes_[t$1+1]=e$1>>8,this.bytes_[t$1+2]=e$1>>16,this.bytes_[t$1+3]=e$1>>24},r.ByteBuffer.prototype.writeInt64=function(t$1,e$1){this.writeInt32(t$1,e$1.low),this.writeInt32(t$1+4,e$1.high)},r.ByteBuffer.prototype.writeUint64=function(t$1,e$1){this.writeUint32(t$1,e$1.low),this.writeUint32(t$1+4,e$1.high)},r.ByteBuffer.prototype.writeFloat32=function(t$1,e$1){r.float32[0]=e$1,this.writeInt32(t$1,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t$1,e$1){r.float64[0]=e$1,this.writeInt32(t$1,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t$1+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a)))}return i},r.ByteBuffer.prototype.__indirect=function(t$1){return t$1+this.readInt32(t$1)},r.ByteBuffer.prototype.__vector=function(t$1){return t$1+this.readInt32(t$1)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t$1){return this.readInt32(t$1+this.readInt32(t$1))},r.ByteBuffer.prototype.__has_identifier=function(t$1){if(t$1.length!=r.FILE_IDENTIFIER_LENGTH)throw Error(`FlatBuffers: file identifier must be length `+r.FILE_IDENTIFIER_LENGTH);for(var e$1=0;e$1{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(t,`__esModule`,{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})())}),require_common=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0})}),require_legacy=__commonJSMin(exports=>{var _a$1;Object.defineProperty(exports,`__esModule`,{value:!0}),exports.SileroLegacy=void 0;let logging_1$3=require_logging();var SileroLegacy=class{constructor(ortInstance$2,_session,_h,_c,_sr){this.ortInstance=ortInstance$2,this._session=_session,this._h=_h,this._c=_c,this._sr=_sr,this.reset_state=()=>{let zeroes=Array(2*64).fill(0);this._h=new this.ortInstance.Tensor(`float32`,zeroes,[2,1,64]),this._c=new this.ortInstance.Tensor(`float32`,zeroes,[2,1,64])},this.process=async audioFrame=>{var _out$output;let t=new this.ortInstance.Tensor(`float32`,audioFrame,[1,audioFrame.length]),inputs={input:t,h:this._h,c:this._c,sr:this._sr},out=await this._session.run(inputs);this._h=out.hn,this._c=out.cn;let[isSpeech]=(_out$output=out.output)?.data,notSpeech=1-isSpeech;return{notSpeech,isSpeech}}}};exports.SileroLegacy=SileroLegacy,_a$1=SileroLegacy,SileroLegacy.new=async(ortInstance$2,modelFetcher)=>{logging_1$3.log.debug(`initializing vad`);let modelArrayBuffer=await modelFetcher(),_session=await ortInstance$2.InferenceSession.create(modelArrayBuffer),_sr=new ortInstance$2.Tensor(`int64`,[16000n]),zeroes=Array(2*64).fill(0),_h=new ortInstance$2.Tensor(`float32`,zeroes,[2,1,64]),_c=new ortInstance$2.Tensor(`float32`,zeroes,[2,1,64]);logging_1$3.log.debug(`vad is initialized`);let model=new _a$1(ortInstance$2,_session,_h,_c,_sr);return model}}),require_v5=__commonJSMin(exports=>{var _a;Object.defineProperty(exports,`__esModule`,{value:!0}),exports.SileroV5=void 0;let logging_1$2=require_logging();function getNewState(ortInstance$2){let zeroes=Array(2*128).fill(0);return new ortInstance$2.Tensor(`float32`,zeroes,[2,1,128])}var SileroV5=class{constructor(_session,_state,_sr,ortInstance$2){this._session=_session,this._state=_state,this._sr=_sr,this.ortInstance=ortInstance$2,this.reset_state=()=>{this._state=getNewState(this.ortInstance)},this.process=async audioFrame=>{var _out$output2;let t=new this.ortInstance.Tensor(`float32`,audioFrame,[1,audioFrame.length]),inputs={input:t,state:this._state,sr:this._sr},out=await this._session.run(inputs);this._state=out.stateN;let[isSpeech]=(_out$output2=out.output)?.data,notSpeech=1-isSpeech;return{notSpeech,isSpeech}}}};exports.SileroV5=SileroV5,_a=SileroV5,SileroV5.new=async(ortInstance$2,modelFetcher)=>{logging_1$2.log.debug(`Loading VAD...`);let modelArrayBuffer=await modelFetcher(),_session=await ortInstance$2.InferenceSession.create(modelArrayBuffer),_sr=new ortInstance$2.Tensor(`int64`,[16000n]),_state=getNewState(ortInstance$2);return logging_1$2.log.debug(`...finished loading VAD`),new _a(_session,_state,_sr,ortInstance$2)}}),require_models=__commonJSMin(exports=>{var __createBinding$2=Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||(`get`in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__exportStar=function(m,exports$1){for(var p$1 in m)p$1!==`default`&&!Object.prototype.hasOwnProperty.call(exports$1,p$1)&&__createBinding$2(exports$1,m,p$1)};Object.defineProperty(exports,`__esModule`,{value:!0}),exports.SileroV5=exports.SileroLegacy=void 0,__exportStar(require_common(),exports);var legacy_1=require_legacy();Object.defineProperty(exports,`SileroLegacy`,{enumerable:!0,get:function(){return legacy_1.SileroLegacy}});var v5_1=require_v5();Object.defineProperty(exports,`SileroV5`,{enumerable:!0,get:function(){return v5_1.SileroV5}})}),require_resampler=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Resampler=void 0;let logging_1$1=require_logging();var Resampler=class{constructor(options){this.options=options,this.process=audioFrame=>{let outputFrames=[];for(let sample of audioFrame)for(this.inputBuffer.push(sample);this.hasEnoughDataForFrame();){let outputFrame=this.generateOutputFrame();outputFrames.push(outputFrame)}return outputFrames},options.nativeSampleRate<16e3&&logging_1$1.log.error(`nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate`),this.inputBuffer=[]}async*stream(audioInput){for(let sample of audioInput)for(this.inputBuffer.push(sample);this.hasEnoughDataForFrame();){let outputFrame=this.generateOutputFrame();yield outputFrame}}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){let outputFrame=new Float32Array(this.options.targetFrameSize),outputIndex=0,inputIndex=0;for(;outputIndex{var __createBinding$1=Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||(`get`in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__setModuleDefault$1=Object.create?function(o,v){Object.defineProperty(o,`default`,{enumerable:!0,value:v})}:function(o,v){o.default=v},__importStar$1=function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!==`default`&&Object.prototype.hasOwnProperty.call(mod,k)&&__createBinding$1(result,mod,k);return __setModuleDefault$1(result,mod),result};Object.defineProperty(exports,`__esModule`,{value:!0}),exports.NonRealTimeVAD=exports.defaultNonRealTimeVADOptions=void 0;let ortInstance$1=__importStar$1(require_ort_web_min()),asset_path_1$1=require_asset_path(),default_model_fetcher_1$2=require_default_model_fetcher(),frame_processor_1$2=require_frame_processor(),messages_1$2=require_messages(),models_1$1=require_models(),resampler_1$1=require_resampler();exports.defaultNonRealTimeVADOptions={...frame_processor_1$2.defaultLegacyFrameProcessorOptions,ortConfig:void 0,modelURL:asset_path_1$1.baseAssetPath+`silero_vad_legacy.onnx`,modelFetcher:default_model_fetcher_1$2.defaultModelFetcher};var NonRealTimeVAD=class{static async new(options={}){let fullOptions={...exports.defaultNonRealTimeVADOptions,...options};(0,frame_processor_1$2.validateOptions)(fullOptions),fullOptions.ortConfig!==void 0&&fullOptions.ortConfig(ortInstance$1);let modelFetcher=()=>fullOptions.modelFetcher(fullOptions.modelURL),model=await models_1$1.SileroLegacy.new(ortInstance$1,modelFetcher),frameProcessor=new frame_processor_1$2.FrameProcessor(model.process,model.reset_state,{frameSamples:fullOptions.frameSamples,positiveSpeechThreshold:fullOptions.positiveSpeechThreshold,negativeSpeechThreshold:fullOptions.negativeSpeechThreshold,redemptionFrames:fullOptions.redemptionFrames,preSpeechPadFrames:fullOptions.preSpeechPadFrames,minSpeechFrames:fullOptions.minSpeechFrames,submitUserSpeechOnPause:fullOptions.submitUserSpeechOnPause});frameProcessor.resume();let vad=new this(modelFetcher,ortInstance$1,fullOptions,frameProcessor);return vad}constructor(modelFetcher,ort,options,frameProcessor){this.modelFetcher=modelFetcher,this.ort=ort,this.options=options,this.frameProcessor=frameProcessor}async*run(inputAudio,sampleRate){let resamplerOptions={nativeSampleRate:sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},resampler=new resampler_1$1.Resampler(resamplerOptions),start=0,end=0,frameIndex=0,messageContainer=[];for await(let frame of resampler.stream(inputAudio)){await this.frameProcessor.process(frame,event=>{messageContainer.push(event)});for(let event of messageContainer)switch(event.msg){case messages_1$2.Message.SpeechStart:start=frameIndex*this.options.frameSamples/16;break;case messages_1$2.Message.SpeechEnd:end=(frameIndex+1)*this.options.frameSamples/16,yield{audio:event.audio,start,end};break;default:break}frameIndex++}let{msg,audio}=this.frameProcessor.endSegment(event=>{messageContainer.push(event)});for(let event of messageContainer)switch(event.msg){case messages_1$2.Message.SpeechEnd:yield{audio:event.audio,start,end:frameIndex*this.options.frameSamples/16}}}};exports.NonRealTimeVAD=NonRealTimeVAD}),require_utils=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.audioFileToArray=exports.encodeWAV=exports.arrayBufferToBase64=exports.minFramesForTargetMS=void 0;function minFramesForTargetMS(targetDuration,frameSamples,sr=16e3){return Math.ceil(targetDuration*sr/1e3/frameSamples)}exports.minFramesForTargetMS=minFramesForTargetMS;function arrayBufferToBase64(buffer){let bytes=new Uint8Array(buffer),len=bytes.byteLength,binary=Array(len);for(var i=0;i{reader.addEventListener(`loadend`,ev=>{let audioData=reader.result;ctx.decodeAudioData(audioData,buffer=>{audioBuffer=buffer,ctx.startRendering().then(renderedBuffer=>{console.log(`Rendering completed successfully`),res()}).catch(err=>{console.error(`Rendering failed: ${err}`)})},e=>{console.log(`Error with decoding audio data: ${e}`)})}),reader.readAsArrayBuffer(audioFileData)}),audioBuffer===null)throw Error(`some shit`);let _audioBuffer=audioBuffer,out=new Float32Array(_audioBuffer.length);for(let i=0;i<_audioBuffer.length;i++)for(let j=0;j<_audioBuffer.numberOfChannels;j++)out[i]+=_audioBuffer.getChannelData(j)[i];return{audio:out,sampleRate:_audioBuffer.sampleRate}}exports.audioFileToArray=audioFileToArray}),require_real_time_vad=__commonJSMin(exports=>{var __createBinding=Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||(`get`in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]},__setModuleDefault=Object.create?function(o,v){Object.defineProperty(o,`default`,{enumerable:!0,value:v})}:function(o,v){o.default=v},__importStar=function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!==`default`&&Object.prototype.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,`__esModule`,{value:!0}),exports.AudioNodeVAD=exports.MicVAD=exports.getDefaultRealTimeVADOptions=exports.ort=exports.DEFAULT_MODEL=void 0;let ortInstance=__importStar(require_ort_web_min()),default_model_fetcher_1$1=require_default_model_fetcher(),frame_processor_1$1=require_frame_processor(),logging_1=require_logging(),messages_1$1=require_messages(),models_1=require_models(),resampler_1=require_resampler();exports.DEFAULT_MODEL=`legacy`,exports.ort=ortInstance;let workletFile=`vad.worklet.bundle.min.js`,sileroV5File=`silero_vad_v5.onnx`,sileroLegacyFile=`silero_vad_legacy.onnx`,getDefaultRealTimeVADOptions$1=model=>{let frameProcessorOptions=model===`v5`?frame_processor_1$1.defaultV5FrameProcessorOptions:frame_processor_1$1.defaultLegacyFrameProcessorOptions;return{...frameProcessorOptions,onFrameProcessed:(probabilities,frame)=>{},onVADMisfire:()=>{logging_1.log.debug(`VAD misfire`)},onSpeechStart:()=>{logging_1.log.debug(`Detected speech start`)},onSpeechEnd:()=>{logging_1.log.debug(`Detected speech end`)},onSpeechRealStart:()=>{logging_1.log.debug(`Detected real speech start`)},baseAssetPath:`https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@latest/dist/`,onnxWASMBasePath:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/`,stream:void 0,ortConfig:void 0,model,workletOptions:{}}};exports.getDefaultRealTimeVADOptions=getDefaultRealTimeVADOptions$1;var MicVAD$1=class MicVAD$1{static async new(options={}){let fullOptions={...(0,exports.getDefaultRealTimeVADOptions)(options.model??exports.DEFAULT_MODEL),...options};(0,frame_processor_1$1.validateOptions)(fullOptions);let stream;stream=fullOptions.stream===void 0?await navigator.mediaDevices.getUserMedia({audio:{...fullOptions.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):fullOptions.stream;let audioContext=new AudioContext,sourceNode=new MediaStreamAudioSourceNode(audioContext,{mediaStream:stream}),audioNodeVAD=await AudioNodeVAD.new(audioContext,fullOptions);return audioNodeVAD.receive(sourceNode),new MicVAD$1(fullOptions,audioContext,stream,audioNodeVAD,sourceNode)}constructor(options,audioContext,stream,audioNodeVAD,sourceNode,listening=!1){this.options=options,this.audioContext=audioContext,this.stream=stream,this.audioNodeVAD=audioNodeVAD,this.sourceNode=sourceNode,this.listening=listening,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),this.options.stream===void 0&&this.stream.getTracks().forEach(track=>track.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()},this.setOptions=options$1=>{this.audioNodeVAD.setFrameProcessorOptions(options$1)}}};exports.MicVAD=MicVAD$1;var AudioNodeVAD=class AudioNodeVAD{static async new(ctx,options={}){let fullOptions={...(0,exports.getDefaultRealTimeVADOptions)(options.model??exports.DEFAULT_MODEL),...options};(0,frame_processor_1$1.validateOptions)(fullOptions),exports.ort.env.wasm.wasmPaths=fullOptions.onnxWASMBasePath,fullOptions.ortConfig!==void 0&&fullOptions.ortConfig(exports.ort);let modelFile=fullOptions.model===`v5`?sileroV5File:sileroLegacyFile,modelURL=fullOptions.baseAssetPath+modelFile,modelFactory=fullOptions.model===`v5`?models_1.SileroV5.new:models_1.SileroLegacy.new,model;try{model=await modelFactory(exports.ort,()=>(0,default_model_fetcher_1$1.defaultModelFetcher)(modelURL))}catch(e){throw console.error(`Encountered an error while loading model file ${modelURL}`),e}let frameProcessor=new frame_processor_1$1.FrameProcessor(model.process,model.reset_state,{frameSamples:fullOptions.frameSamples,positiveSpeechThreshold:fullOptions.positiveSpeechThreshold,negativeSpeechThreshold:fullOptions.negativeSpeechThreshold,redemptionFrames:fullOptions.redemptionFrames,preSpeechPadFrames:fullOptions.preSpeechPadFrames,minSpeechFrames:fullOptions.minSpeechFrames,submitUserSpeechOnPause:fullOptions.submitUserSpeechOnPause}),audioNodeVAD=new AudioNodeVAD(ctx,fullOptions,frameProcessor);return await audioNodeVAD.setupAudioNode(),audioNodeVAD}constructor(ctx,options,frameProcessor){this.ctx=ctx,this.options=options,this.bufferIndex=0,this.pause=()=>{this.frameProcessor.pause(this.handleFrameProcessorEvent)},this.start=()=>{this.frameProcessor.resume()},this.receive=node$1=>{node$1.connect(this.audioNode)},this.processFrame=async frame=>{await this.frameProcessor.process(frame,this.handleFrameProcessorEvent)},this.handleFrameProcessorEvent=ev=>{switch(ev.msg){case messages_1$1.Message.FrameProcessed:this.options.onFrameProcessed(ev.probs,ev.frame);break;case messages_1$1.Message.SpeechStart:this.options.onSpeechStart();break;case messages_1$1.Message.SpeechRealStart:this.options.onSpeechRealStart();break;case messages_1$1.Message.VADMisfire:this.options.onVADMisfire();break;case messages_1$1.Message.SpeechEnd:this.options.onSpeechEnd(ev.audio);break}},this.destroy=()=>{var _this$gainNode;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:messages_1$1.Message.SpeechStop}),this.audioNode.disconnect(),(_this$gainNode=this.gainNode)?.disconnect()},this.setFrameProcessorOptions=options$1=>{this.frameProcessor.options={...this.frameProcessor.options,...options$1}},this.frameProcessor=frameProcessor}async setupAudioNode(){let hasAudioWorklet=`audioWorklet`in this.ctx&&typeof AudioWorkletNode==`function`;if(hasAudioWorklet)try{let workletURL=this.options.baseAssetPath+workletFile;await this.ctx.audioWorklet.addModule(workletURL);let workletOptions=this.options.workletOptions??{};workletOptions.processorOptions={...workletOptions.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,`vad-helper-worklet`,workletOptions),this.audioNode.port.onmessage=async ev=>{var _ev$data;switch((_ev$data=ev.data)?.message){case messages_1$1.Message.AudioFrame:let buffer=ev.data.data;buffer instanceof ArrayBuffer||(buffer=new ArrayBuffer(ev.data.data.byteLength),new Uint8Array(buffer).set(new Uint8Array(ev.data.data)));let frame=new Float32Array(buffer);await this.processFrame(frame);break}};return}catch(e){console.log(`AudioWorklet setup failed, falling back to ScriptProcessor`,e)}this.resampler=new resampler_1.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});let bufferSize=4096;this.audioNode=this.ctx.createScriptProcessor(bufferSize,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let processingAudio=!1;this.audioNode.onaudioprocess=async e=>{if(!processingAudio){processingAudio=!0;try{let input=e.inputBuffer.getChannelData(0),output=e.outputBuffer.getChannelData(0);if(output.fill(0),this.resampler){let frames=this.resampler.process(input);for(let frame of frames)await this.processFrame(frame)}}catch(error){console.error(`Error processing audio:`,error)}finally{processingAudio=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}};exports.AudioNodeVAD=AudioNodeVAD}),require_dist=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.getDefaultRealTimeVADOptions=exports.MicVAD=exports.DEFAULT_MODEL=exports.AudioNodeVAD=exports.utils=exports.NonRealTimeVAD=exports.Message=exports.FrameProcessor=exports.defaultModelFetcher=exports.baseAssetPath=void 0;var asset_path_1=require_asset_path();Object.defineProperty(exports,`baseAssetPath`,{enumerable:!0,get:function(){return asset_path_1.baseAssetPath}});var default_model_fetcher_1=require_default_model_fetcher();Object.defineProperty(exports,`defaultModelFetcher`,{enumerable:!0,get:function(){return default_model_fetcher_1.defaultModelFetcher}});var frame_processor_1=require_frame_processor();Object.defineProperty(exports,`FrameProcessor`,{enumerable:!0,get:function(){return frame_processor_1.FrameProcessor}});var messages_1=require_messages();Object.defineProperty(exports,`Message`,{enumerable:!0,get:function(){return messages_1.Message}});var non_real_time_vad_1=require_non_real_time_vad();Object.defineProperty(exports,`NonRealTimeVAD`,{enumerable:!0,get:function(){return non_real_time_vad_1.NonRealTimeVAD}});let utils_1=require_utils();exports.utils={audioFileToArray:utils_1.audioFileToArray,minFramesForTargetMS:utils_1.minFramesForTargetMS,arrayBufferToBase64:utils_1.arrayBufferToBase64,encodeWAV:utils_1.encodeWAV};var real_time_vad_1=require_real_time_vad();Object.defineProperty(exports,`AudioNodeVAD`,{enumerable:!0,get:function(){return real_time_vad_1.AudioNodeVAD}}),Object.defineProperty(exports,`DEFAULT_MODEL`,{enumerable:!0,get:function(){return real_time_vad_1.DEFAULT_MODEL}}),Object.defineProperty(exports,`MicVAD`,{enumerable:!0,get:function(){return real_time_vad_1.MicVAD}}),Object.defineProperty(exports,`getDefaultRealTimeVADOptions`,{enumerable:!0,get:function(){return real_time_vad_1.getDefaultRealTimeVADOptions}})}),import_dist=__toESM(require_dist());function useMicVAD(deviceId,options={}){let opts=merge({...(0,import_dist.getDefaultRealTimeVADOptions)(`v5`),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0},options),micVad=ref(),microphoneAccess=usePermission(`microphone`);async function update(){if(micVad.value&&(micVad.value.destroy(),micVad.value=void 0,console.warn(`existing MicVAD destroyed`)),!microphoneAccess.value)return;let id=unref(deviceId);if(!id)return;let media=await navigator.mediaDevices.getUserMedia({audio:{deviceId:id}});micVad.value=await import_dist.MicVAD.new({...opts,stream:media}),opts.auto&&micVad.value.start()}return watch(microphoneAccess,update,{immediate:!0}),watch(toRef(deviceId),update,{immediate:!0}),tryOnMounted(update),onUnmounted(()=>{micVad.value&&(micVad.value.destroy(),micVad.value=void 0)}),{destroy:()=>{micVad.value&&(micVad.value.destroy(),micVad.value=void 0)},start:()=>{micVad.value&&micVad.value.start()}}} /*! * @pixiv/three-vrm-animation v3.4.1 * The implementation of VRM Animation @@ -1115,4 +1115,4 @@ void main() { * @pixiv/three-vrm-springbone is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -function toTrianglesDrawMode(geometry,drawMode){if(drawMode===TrianglesDrawMode)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),geometry;if(drawMode===TriangleFanDrawMode||drawMode===TriangleStripDrawMode){let index$1=geometry.getIndex();if(index$1===null){let indices=[],position$2=geometry.getAttribute(`position`);if(position$2!==void 0){for(let i=0;i=2.0 are supported.`));return}let parser=new GLTFParser(json,{path:path||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});parser.fileLoader.setRequestHeader(this.requestHeader);for(let i=0;i=0&&plugins[extensionName]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+extensionName+`".`)}}parser.setExtensions(extensions),parser.setPlugins(plugins),parser.parse(onLoad,onError)}parseAsync(data,path){let scope=this;return new Promise(function(resolve,reject){scope.parse(data,path,resolve,reject)})}};function GLTFRegistry(){let objects={};return{get:function(key$1){return objects[key$1]},add:function(key$1,object){objects[key$1]=object},remove:function(key$1){delete objects[key$1]},removeAll:function(){objects={}}}}const EXTENSIONS={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`};var GLTFLightsExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let parser=this.parser,nodeDefs=this.parser.json.nodes||[];for(let nodeIndex=0,nodeLength=nodeDefs.length;nodeIndex=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFTextureWebPExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_WEBP}loadTexture(textureIndex){let name$1=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name$1])return null;let extension$1=textureDef.extensions[name$1],source=json.images[extension$1.source],loader$1=parser.textureLoader;if(source.uri){let handler=parser.options.manager.getHandler(source.uri);handler!==null&&(loader$1=handler)}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFTextureAVIFExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_AVIF}loadTexture(textureIndex){let name$1=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name$1])return null;let extension$1=textureDef.extensions[name$1],source=json.images[extension$1.source],loader$1=parser.textureLoader;if(source.uri){let handler=parser.options.manager.getHandler(source.uri);handler!==null&&(loader$1=handler)}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFMeshoptCompression=class{constructor(parser){this.name=EXTENSIONS.EXT_MESHOPT_COMPRESSION,this.parser=parser}loadBufferView(index$1){let json=this.parser.json,bufferView=json.bufferViews[index$1];if(bufferView.extensions&&bufferView.extensions[this.name]){let extensionDef=bufferView.extensions[this.name],buffer=this.parser.getDependency(`buffer`,extensionDef.buffer),decoder=this.parser.options.meshoptDecoder;if(!decoder||!decoder.supported){if(json.extensionsRequired&&json.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return buffer.then(function(res){let byteOffset=extensionDef.byteOffset||0,byteLength=extensionDef.byteLength||0,count=extensionDef.count,stride=extensionDef.byteStride,source=new Uint8Array(res,byteOffset,byteLength);return decoder.decodeGltfBufferAsync?decoder.decodeGltfBufferAsync(count,stride,source,extensionDef.mode,extensionDef.filter).then(function(res$1){return res$1.buffer}):decoder.ready.then(function(){let result=new ArrayBuffer(count*stride);return decoder.decodeGltfBuffer(new Uint8Array(result),count,stride,source,extensionDef.mode,extensionDef.filter),result})})}else return null}},GLTFMeshGpuInstancing=class{constructor(parser){this.name=EXTENSIONS.EXT_MESH_GPU_INSTANCING,this.parser=parser}createNodeMesh(nodeIndex){let json=this.parser.json,nodeDef=json.nodes[nodeIndex];if(!nodeDef.extensions||!nodeDef.extensions[this.name]||nodeDef.mesh===void 0)return null;let meshDef=json.meshes[nodeDef.mesh];for(let primitive of meshDef.primitives)if(primitive.mode!==WEBGL_CONSTANTS.TRIANGLES&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_STRIP&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_FAN&&primitive.mode!==void 0)return null;let extensionDef=nodeDef.extensions[this.name],attributesDef=extensionDef.attributes,pending=[],attributes={};for(let key$1 in attributesDef)pending.push(this.parser.getDependency(`accessor`,attributesDef[key$1]).then(accessor=>(attributes[key$1]=accessor,attributes[key$1])));return pending.length<1?null:(pending.push(this.parser.createNodeMesh(nodeIndex)),Promise.all(pending).then(results=>{let nodeObject=results.pop(),meshes=nodeObject.isGroup?nodeObject.children:[nodeObject],count=results[0].count,instancedMeshes=[];for(let mesh of meshes){let m=new Matrix4,p$1=new Vector3,q=new Quaternion,s=new Vector3(1,1,1),instancedMesh=new InstancedMesh(mesh.geometry,mesh.material,count);for(let i=0;i0||uri.search(/^data\:image\/jpeg/)===0?`image/jpeg`:uri.search(/\.webp($|\?)/i)>0||uri.search(/^data\:image\/webp/)===0?`image/webp`:uri.search(/\.ktx2($|\?)/i)>0||uri.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}const _identityMatrix=new Matrix4;var GLTFParser=class{constructor(json={},options={}){this.json=json,this.extensions={},this.plugins={},this.options=options,this.cache=new GLTFRegistry,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let isSafari=!1,safariVersion=-1,isFirefox=!1,firefoxVersion=-1;if(typeof navigator<`u`){let userAgent=navigator.userAgent;isSafari=/^((?!chrome|android).)*safari/i.test(userAgent)===!0;let safariMatch=userAgent.match(/Version\/(\d+)/);safariVersion=isSafari&&safariMatch?parseInt(safariMatch[1],10):-1,isFirefox=userAgent.indexOf(`Firefox`)>-1,firefoxVersion=isFirefox?userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>`u`||isSafari&&safariVersion<17||isFirefox&&firefoxVersion<98?this.textureLoader=new TextureLoader(this.options.manager):this.textureLoader=new ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new FileLoader(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(extensions){this.extensions=extensions}setPlugins(plugins){this.plugins=plugins}parse(onLoad,onError){let parser=this,json=this.json,extensions=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(ext){return ext._markDefs&&ext._markDefs()}),Promise.all(this._invokeAll(function(ext){return ext.beforeRoot&&ext.beforeRoot()})).then(function(){return Promise.all([parser.getDependencies(`scene`),parser.getDependencies(`animation`),parser.getDependencies(`camera`)])}).then(function(dependencies){let result={scene:dependencies[0][json.scene||0],scenes:dependencies[0],animations:dependencies[1],cameras:dependencies[2],asset:json.asset,parser,userData:{}};return addUnknownExtensionsToUserData(extensions,result,json),assignExtrasToUserData(result,json),Promise.all(parser._invokeAll(function(ext){return ext.afterRoot&&ext.afterRoot(result)})).then(function(){for(let scene of result.scenes)scene.updateMatrixWorld();onLoad(result)})}).catch(onError)}_markDefs(){let nodeDefs=this.json.nodes||[],skinDefs=this.json.skins||[],meshDefs=this.json.meshes||[];for(let skinIndex=0,skinLength=skinDefs.length;skinIndex{let mappings=this.associations.get(original);mappings!=null&&this.associations.set(clone,mappings);for(let[i,child]of original.children.entries())updateMappings(child,clone.children[i])};return updateMappings(object,ref$1),ref$1.name+=`_instance_`+ cache.uses[index$1]++,ref$1}_invokeOne(func){let extensions=Object.values(this.plugins);extensions.push(this);for(let i=0;i=2&&bufferAttribute.setY(index$1,sparseValues[i*itemSize+1]),itemSize>=3&&bufferAttribute.setZ(index$1,sparseValues[i*itemSize+2]),itemSize>=4&&bufferAttribute.setW(index$1,sparseValues[i*itemSize+3]),itemSize>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}bufferAttribute.normalized=normalized}return bufferAttribute})}loadTexture(textureIndex){let json=this.json,options=this.options,textureDef=json.textures[textureIndex],sourceIndex=textureDef.source,sourceDef=json.images[sourceIndex],loader$1=this.textureLoader;if(sourceDef.uri){let handler=options.manager.getHandler(sourceDef.uri);handler!==null&&(loader$1=handler)}return this.loadTextureImage(textureIndex,sourceIndex,loader$1)}loadTextureImage(textureIndex,sourceIndex,loader$1){let parser=this,json=this.json,textureDef=json.textures[textureIndex],sourceDef=json.images[sourceIndex],cacheKey=(sourceDef.uri||sourceDef.bufferView)+`:`+textureDef.sampler;if(this.textureCache[cacheKey])return this.textureCache[cacheKey];let promise=this.loadImageSource(sourceIndex,loader$1).then(function(texture){texture.flipY=!1,texture.name=textureDef.name||sourceDef.name||``,texture.name===``&&typeof sourceDef.uri==`string`&&sourceDef.uri.startsWith(`data:image/`)===!1&&(texture.name=sourceDef.uri);let samplers=json.samplers||{},sampler=samplers[textureDef.sampler]||{};return texture.magFilter=WEBGL_FILTERS[sampler.magFilter]||LinearFilter,texture.minFilter=WEBGL_FILTERS[sampler.minFilter]||LinearMipmapLinearFilter,texture.wrapS=WEBGL_WRAPPINGS[sampler.wrapS]||RepeatWrapping,texture.wrapT=WEBGL_WRAPPINGS[sampler.wrapT]||RepeatWrapping,texture.generateMipmaps=!texture.isCompressedTexture&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter,parser.associations.set(texture,{textures:textureIndex}),texture}).catch(function(){return null});return this.textureCache[cacheKey]=promise,promise}loadImageSource(sourceIndex,loader$1){let parser=this,json=this.json,options=this.options;if(this.sourceCache[sourceIndex]!==void 0)return this.sourceCache[sourceIndex].then(texture=>texture.clone());let sourceDef=json.images[sourceIndex],URL$1=self.URL||self.webkitURL,sourceURI=sourceDef.uri||``,isObjectURL=!1;if(sourceDef.bufferView!==void 0)sourceURI=parser.getDependency(`bufferView`,sourceDef.bufferView).then(function(bufferView){isObjectURL=!0;let blob=new Blob([bufferView],{type:sourceDef.mimeType});return sourceURI=URL$1.createObjectURL(blob),sourceURI});else if(sourceDef.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+sourceIndex+` is missing URI and bufferView`);let promise=Promise.resolve(sourceURI).then(function(sourceURI$1){return new Promise(function(resolve,reject){let onLoad=resolve;loader$1.isImageBitmapLoader===!0&&(onLoad=function(imageBitmap){let texture=new Texture(imageBitmap);texture.needsUpdate=!0,resolve(texture)}),loader$1.load(LoaderUtils.resolveURL(sourceURI$1,options.path),onLoad,void 0,reject)})}).then(function(texture){return isObjectURL===!0&&URL$1.revokeObjectURL(sourceURI),assignExtrasToUserData(texture,sourceDef),texture.userData.mimeType=sourceDef.mimeType||getImageURIMimeType(sourceDef.uri),texture}).catch(function(error){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,sourceURI),error});return this.sourceCache[sourceIndex]=promise,promise}assignTexture(materialParams,mapName,mapDef,colorSpace){let parser=this;return this.getDependency(`texture`,mapDef.index).then(function(texture){if(!texture)return null;if(mapDef.texCoord!==void 0&&mapDef.texCoord>0&&(texture=texture.clone(),texture.channel=mapDef.texCoord),parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]){let transform=mapDef.extensions===void 0?void 0:mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM];if(transform){let gltfReference=parser.associations.get(texture);texture=parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture,transform),parser.associations.set(texture,gltfReference)}}return colorSpace!==void 0&&(texture.colorSpace=colorSpace),materialParams[mapName]=texture,texture})}assignFinalMaterial(mesh){let geometry=mesh.geometry,material=mesh.material,useDerivativeTangents=geometry.attributes.tangent===void 0,useVertexColors=geometry.attributes.color!==void 0,useFlatShading=geometry.attributes.normal===void 0;if(mesh.isPoints){let cacheKey=`PointsMaterial:`+material.uuid,pointsMaterial=this.cache.get(cacheKey);pointsMaterial||(pointsMaterial=new PointsMaterial,Material.prototype.copy.call(pointsMaterial,material),pointsMaterial.color.copy(material.color),pointsMaterial.map=material.map,pointsMaterial.sizeAttenuation=!1,this.cache.add(cacheKey,pointsMaterial)),material=pointsMaterial}else if(mesh.isLine){let cacheKey=`LineBasicMaterial:`+material.uuid,lineMaterial=this.cache.get(cacheKey);lineMaterial||(lineMaterial=new LineBasicMaterial,Material.prototype.copy.call(lineMaterial,material),lineMaterial.color.copy(material.color),lineMaterial.map=material.map,this.cache.add(cacheKey,lineMaterial)),material=lineMaterial}if(useDerivativeTangents||useVertexColors||useFlatShading){let cacheKey=`ClonedMaterial:`+material.uuid+`:`;useDerivativeTangents&&(cacheKey+=`derivative-tangents:`),useVertexColors&&(cacheKey+=`vertex-colors:`),useFlatShading&&(cacheKey+=`flat-shading:`);let cachedMaterial=this.cache.get(cacheKey);cachedMaterial||(cachedMaterial=material.clone(),useVertexColors&&(cachedMaterial.vertexColors=!0),useFlatShading&&(cachedMaterial.flatShading=!0),useDerivativeTangents&&(cachedMaterial.normalScale&&(cachedMaterial.normalScale.y*=-1),cachedMaterial.clearcoatNormalScale&&(cachedMaterial.clearcoatNormalScale.y*=-1)),this.cache.add(cacheKey,cachedMaterial),this.associations.set(cachedMaterial,this.associations.get(material))),material=cachedMaterial}mesh.material=material}getMaterialType(){return MeshStandardMaterial}loadMaterial(materialIndex){let parser=this,json=this.json,extensions=this.extensions,materialDef=json.materials[materialIndex],materialType,materialParams={},materialExtensions=materialDef.extensions||{},pending=[];if(materialExtensions[EXTENSIONS.KHR_MATERIALS_UNLIT]){let kmuExtension=extensions[EXTENSIONS.KHR_MATERIALS_UNLIT];materialType=kmuExtension.getMaterialType(),pending.push(kmuExtension.extendParams(materialParams,materialDef,parser))}else{let metallicRoughness=materialDef.pbrMetallicRoughness||{};if(materialParams.color=new Color(1,1,1),materialParams.opacity=1,Array.isArray(metallicRoughness.baseColorFactor)){let array=metallicRoughness.baseColorFactor;materialParams.color.setRGB(array[0],array[1],array[2],LinearSRGBColorSpace),materialParams.opacity=array[3]}metallicRoughness.baseColorTexture!==void 0&&pending.push(parser.assignTexture(materialParams,`map`,metallicRoughness.baseColorTexture,SRGBColorSpace)),materialParams.metalness=metallicRoughness.metallicFactor===void 0?1:metallicRoughness.metallicFactor,materialParams.roughness=metallicRoughness.roughnessFactor===void 0?1:metallicRoughness.roughnessFactor,metallicRoughness.metallicRoughnessTexture!==void 0&&(pending.push(parser.assignTexture(materialParams,`metalnessMap`,metallicRoughness.metallicRoughnessTexture)),pending.push(parser.assignTexture(materialParams,`roughnessMap`,metallicRoughness.metallicRoughnessTexture))),materialType=this._invokeOne(function(ext){return ext.getMaterialType&&ext.getMaterialType(materialIndex)}),pending.push(Promise.all(this._invokeAll(function(ext){return ext.extendMaterialParams&&ext.extendMaterialParams(materialIndex,materialParams)})))}materialDef.doubleSided===!0&&(materialParams.side=DoubleSide);let alphaMode=materialDef.alphaMode||ALPHA_MODES.OPAQUE;if(alphaMode===ALPHA_MODES.BLEND?(materialParams.transparent=!0,materialParams.depthWrite=!1):(materialParams.transparent=!1,alphaMode===ALPHA_MODES.MASK&&(materialParams.alphaTest=materialDef.alphaCutoff===void 0?.5:materialDef.alphaCutoff)),materialDef.normalTexture!==void 0&&materialType!==MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,`normalMap`,materialDef.normalTexture)),materialParams.normalScale=new Vector2(1,1),materialDef.normalTexture.scale!==void 0)){let scale=materialDef.normalTexture.scale;materialParams.normalScale.set(scale,scale)}if(materialDef.occlusionTexture!==void 0&&materialType!==MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,`aoMap`,materialDef.occlusionTexture)),materialDef.occlusionTexture.strength!==void 0&&(materialParams.aoMapIntensity=materialDef.occlusionTexture.strength)),materialDef.emissiveFactor!==void 0&&materialType!==MeshBasicMaterial){let emissiveFactor=materialDef.emissiveFactor;materialParams.emissive=new Color().setRGB(emissiveFactor[0],emissiveFactor[1],emissiveFactor[2],LinearSRGBColorSpace)}return materialDef.emissiveTexture!==void 0&&materialType!==MeshBasicMaterial&&pending.push(parser.assignTexture(materialParams,`emissiveMap`,materialDef.emissiveTexture,SRGBColorSpace)),Promise.all(pending).then(function(){let material=new materialType(materialParams);return materialDef.name&&(material.name=materialDef.name),assignExtrasToUserData(material,materialDef),parser.associations.set(material,{materials:materialIndex}),materialDef.extensions&&addUnknownExtensionsToUserData(extensions,material,materialDef),material})}createUniqueName(originalName){let sanitizedName=PropertyBinding.sanitizeNodeName(originalName||``);return sanitizedName in this.nodeNamesUsed?sanitizedName+`_`+ ++this.nodeNamesUsed[sanitizedName]:(this.nodeNamesUsed[sanitizedName]=0,sanitizedName)}loadGeometries(primitives){let parser=this,extensions=this.extensions,cache=this.primitiveCache;function createDracoPrimitive(primitive){return extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(primitive,parser).then(function(geometry){return addPrimitiveAttributes(geometry,primitive,parser)})}let pending=[];for(let i=0,il=primitives.length;i0&&updateMorphTargets(mesh,meshDef),mesh.name=parser.createUniqueName(meshDef.name||`mesh_`+meshIndex),assignExtrasToUserData(mesh,meshDef),primitive.extensions&&addUnknownExtensionsToUserData(extensions,mesh,primitive),parser.assignFinalMaterial(mesh),meshes.push(mesh)}for(let i=0,il=meshes.length;i1?new Group:objects.length===1?objects[0]:new Object3D,node$1!==objects[0])for(let i=0,il=objects.length;i1){let mapping=parser.associations.get(node$1);parser.associations.set(node$1,{...mapping})}return parser.associations.get(node$1).nodes=nodeIndex,node$1}),this.nodeCache[nodeIndex]}loadScene(sceneIndex){let extensions=this.extensions,sceneDef=this.json.scenes[sceneIndex],parser=this,scene=new Group;sceneDef.name&&(scene.name=parser.createUniqueName(sceneDef.name)),assignExtrasToUserData(scene,sceneDef),sceneDef.extensions&&addUnknownExtensionsToUserData(extensions,scene,sceneDef);let nodeIds=sceneDef.nodes||[],pending=[];for(let i=0,il=nodeIds.length;i{let reducedAssociations=new Map;for(let[key$1,value]of parser.associations)(key$1 instanceof Material||key$1 instanceof Texture)&&reducedAssociations.set(key$1,value);return node$1.traverse(node$2=>{let mappings=parser.associations.get(node$2);mappings!=null&&reducedAssociations.set(node$2,mappings)}),reducedAssociations};return parser.associations=reduceAssociations(scene),scene})}_createAnimationTracks(node$1,inputAccessor,outputAccessor,sampler,target){let tracks=[],targetName=node$1.name?node$1.name:node$1.uuid,targetNames=[];PATH_PROPERTIES[target.path]===PATH_PROPERTIES.weights?node$1.traverse(function(object){object.morphTargetInfluences&&targetNames.push(object.name?object.name:object.uuid)}):targetNames.push(targetName);let TypedKeyframeTrack;switch(PATH_PROPERTIES[target.path]){case PATH_PROPERTIES.weights:TypedKeyframeTrack=NumberKeyframeTrack;break;case PATH_PROPERTIES.rotation:TypedKeyframeTrack=QuaternionKeyframeTrack;break;case PATH_PROPERTIES.translation:case PATH_PROPERTIES.scale:TypedKeyframeTrack=VectorKeyframeTrack;break;default:switch(outputAccessor.itemSize){case 1:TypedKeyframeTrack=NumberKeyframeTrack;break;case 2:case 3:default:TypedKeyframeTrack=VectorKeyframeTrack;break}break}let interpolation=sampler.interpolation===void 0?InterpolateLinear:INTERPOLATION[sampler.interpolation],outputArray=this._getArrayFromAccessor(outputAccessor);for(let j=0,jl=targetNames.length;jnew VRMLoaderPlugin(parser)),loader.register(parser=>new VRMAnimationLoaderPlugin(parser)),loader)}async function loadVRMAnimation(url){let loader$1=useVRMLoader(),gltf=await loader$1.loadAsync(url),userData=gltf.userData;if(!userData.vrmAnimations){console.warn(`No VRM animations found in the .vrma file`);return}if(userData.vrmAnimations.length===0){console.warn(`No VRM animations found in the .vrma file`);return}return userData.vrmAnimations[0]}async function clipFromVRMAnimation(vrm,animation){if(!vrm){console.warn(`No VRM found`);return}if(animation)return createVRMAnimationClip(animation,vrm)}function useBlink(){let isBlinking=ref(!1),blinkProgress=ref(0),timeSinceLastBlink=ref(0),BLINK_DURATION=.2,MIN_BLINK_INTERVAL=1,MAX_BLINK_INTERVAL=6,nextBlinkTime=ref(Math.random()*(MAX_BLINK_INTERVAL-MIN_BLINK_INTERVAL)+MIN_BLINK_INTERVAL);function update(vrm,delta){if(vrm?.expressionManager&&(timeSinceLastBlink.value+=delta,!isBlinking.value&&timeSinceLastBlink.value>=nextBlinkTime.value&&(isBlinking.value=!0,blinkProgress.value=0),isBlinking.value)){blinkProgress.value+=delta/BLINK_DURATION;let blinkValue=Math.sin(Math.PI*blinkProgress.value);vrm.expressionManager.setValue(`blink`,blinkValue),blinkProgress.value>=1&&(isBlinking.value=!1,timeSinceLastBlink.value=0,vrm.expressionManager.setValue(`blink`,0),nextBlinkTime.value=Math.random()*(MAX_BLINK_INTERVAL-MIN_BLINK_INTERVAL)+MIN_BLINK_INTERVAL)}}return{update}}function useIdleEyeSaccades(){let nextSaccadeAfter=-1,fixationTarget,timeSinceLastSaccade=0;function updateFixationTarget(){fixationTarget?fixationTarget.set(randFloat(-.25,.25),randFloat(-.2,.15),-.65):fixationTarget=new Vector3(randFloat(-.25,.25),randFloat(-.2,.15),-.65)}function update(vrm,delta){var _vrm$lookAt;!vrm?.expressionManager||!vrm.lookAt||(timeSinceLastSaccade>=nextSaccadeAfter?(updateFixationTarget(),timeSinceLastSaccade=0,nextSaccadeAfter=randomSaccadeInterval()/1e3):fixationTarget||updateFixationTarget(),vrm.lookAt.target||(vrm.lookAt.target=new Object3D),vrm.lookAt.target.position.lerp(fixationTarget,randFloat(.2,.5)),(_vrm$lookAt=vrm.lookAt)?.update(delta),timeSinceLastSaccade+=delta)}return{update}}async function loadVrm(model,options){let loader$1=useVRMLoader(),gltf=await loader$1.loadAsync(model,progress=>{var _options$onProgress;return options==null||(_options$onProgress=options.onProgress)==null?void 0:_options$onProgress.call(options,progress)}),userData=gltf.userData;if(!userData.vrm)return;let _vrm=userData.vrm;if(VRMUtils.removeUnnecessaryVertices(_vrm.scene),VRMUtils.combineSkeletons(_vrm.scene),_vrm.scene.traverse(object=>{object.frustumCulled=!1}),options?.lookAt&&_vrm.lookAt){let lookAtQuatProxy=new VRMLookAtQuaternionProxy(_vrm.lookAt);lookAtQuatProxy.name=`lookAtQuaternionProxy`,_vrm.scene.add(lookAtQuatProxy)}return options?.scene&&options.scene.add(_vrm.scene),options?.position&&_vrm.scene.position.set(...options.position),_vrm}function useVRMEmote(vrm){let currentEmotion=ref(null),isTransitioning=ref(!1),transitionProgress=ref(0),currentExpressionValues=ref(new Map),targetExpressionValues=ref(new Map),resetTimeout=ref(),lerp$1=(start,end,t)=>start+(end-start)*t,easeInOutCubic=t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2,emotionStates=new Map([[`happy`,{expression:[{name:`happy`,value:1,duration:.3},{name:`aa`,value:.3}],blendDuration:.3}],[`sad`,{expression:[{name:`sad`,value:1},{name:`oh`,value:.2}],blendDuration:.3}],[`angry`,{expression:[{name:`angry`,value:1},{name:`ee`,value:.4}],blendDuration:.2}],[`surprised`,{expression:[{name:`Surprised`,value:1},{name:`oh`,value:.6}],blendDuration:.1}],[`neutral`,{expression:[{name:`neutral`,value:1}],blendDuration:.5}]]),clearResetTimeout=()=>{resetTimeout.value&&(clearTimeout(resetTimeout.value),resetTimeout.value=void 0)},setEmotion=emotionName=>{if(clearResetTimeout(),!emotionStates.has(emotionName)){console.warn(`Emotion ${emotionName} not found`);return}let emotionState=emotionStates.get(emotionName);if(currentEmotion.value=emotionName,isTransitioning.value=!0,transitionProgress.value=0,vrm.expressionManager){let expressionNames=Object.keys(vrm.expressionManager.expressionMap);for(let name$1 of expressionNames)vrm.expressionManager.setValue(name$1,0)}currentExpressionValues.value.clear(),targetExpressionValues.value.clear();for(let expr of emotionState.expression||[]){var _vrm$expressionManage;let currentValue=(_vrm$expressionManage=vrm.expressionManager)?.getValue(expr.name)||0;currentExpressionValues.value.set(expr.name,currentValue),targetExpressionValues.value.set(expr.name,expr.value)}},setEmotionWithResetAfter=(emotionName,ms)=>{clearResetTimeout(),setEmotion(emotionName),resetTimeout.value=setTimeout(()=>{setEmotion(`neutral`),resetTimeout.value=void 0},ms)},update=deltaTime=>{if(!isTransitioning.value||!currentEmotion.value)return;let emotionState=emotionStates.get(currentEmotion.value),blendDuration=emotionState.blendDuration||.3;transitionProgress.value+=deltaTime/blendDuration,transitionProgress.value>=1&&(transitionProgress.value=1,isTransitioning.value=!1);for(let[exprName,targetValue]of targetExpressionValues.value){var _vrm$expressionManage2;let startValue=currentExpressionValues.value.get(exprName)||0,currentValue=lerp$1(startValue,targetValue,easeInOutCubic(transitionProgress.value));(_vrm$expressionManage2=vrm.expressionManager)?.setValue(exprName,currentValue)}},addEmotionState=(emotionName,state)=>{emotionStates.set(emotionName,state)},removeEmotionState=emotionName=>{emotionStates.delete(emotionName)},dispose$1=()=>{clearResetTimeout()};return{currentEmotion,isTransitioning,setEmotion,setEmotionWithResetAfter,update,addEmotionState,removeEmotionState,dispose:dispose$1}}function useWhisper(url,options){let opts=defu(options,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:whisperPost,data:whisperData,terminate}=useWebWorker(url,{type:`module`}),status=ref(null),loadingMessage=ref(``),loadingProgress=ref([]),transcribing=ref(!1),tps=ref(0),result=ref(``);return watch(whisperData,e=>{switch(e.status){case`loading`:var _opts$onLoading;status.value=`loading`,loadingMessage.value=e.data,(_opts$onLoading=opts.onLoading)?.call(opts,e.data);break;case`initiate`:var _opts$onInitiate;loadingProgress.value.push(e),(_opts$onInitiate=opts.onInitiate)?.call(opts,e);break;case`progress`:var _opts$onProgress;loadingProgress.value=loadingProgress.value.map(item=>item.file===e.file?{...item,...e}:item),(_opts$onProgress=opts.onProgress)?.call(opts,e);break;case`done`:var _opts$onDone;loadingProgress.value=loadingProgress.value.filter(item=>item.file!==e.file),(_opts$onDone=opts.onDone)?.call(opts,e);break;case`ready`:var _opts$onReady;status.value=`ready`,(_opts$onReady=opts.onReady)?.call(opts);break;case`start`:var _opts$onStart;transcribing.value=!0,(_opts$onStart=opts.onStart)?.call(opts);break;case`update`:var _opts$onUpdate;tps.value=e.tps,(_opts$onUpdate=opts.onUpdate)?.call(opts,e.tps);break;case`complete`:var _opts$onComplete;transcribing.value=!1,result.value=e.output[0]||``,console.debug(`Whisper result:`,result.value),(_opts$onComplete=opts.onComplete)?.call(opts,e.output[0]);break}}),onUnmounted(()=>{terminate()}),{transcribe:message=>whisperPost(message),status,loadingMessage,loadingProgress,transcribing,tps,result,load:()=>whisperPost({type:`load`}),terminate}}export{VRMUtils,asyncIteratorFromReadableStream,ccount,clipFromVRMAnimation,lerp,loadVRMAnimation,loadVrm,randFloat,randomSaccadeInterval,stringifyEntitiesLight,useBlink,useIdleEyeSaccades,useLlmmarkerParser,useMarkdown,useMicVAD,useVRMEmote,useWhisper}; \ No newline at end of file +function toTrianglesDrawMode(geometry,drawMode){if(drawMode===TrianglesDrawMode)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),geometry;if(drawMode===TriangleFanDrawMode||drawMode===TriangleStripDrawMode){let index$1=geometry.getIndex();if(index$1===null){let indices=[],position$2=geometry.getAttribute(`position`);if(position$2!==void 0){for(let i=0;i=2.0 are supported.`));return}let parser=new GLTFParser(json,{path:path||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});parser.fileLoader.setRequestHeader(this.requestHeader);for(let i=0;i=0&&plugins[extensionName]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+extensionName+`".`)}}parser.setExtensions(extensions),parser.setPlugins(plugins),parser.parse(onLoad,onError)}parseAsync(data,path){let scope=this;return new Promise(function(resolve,reject){scope.parse(data,path,resolve,reject)})}};function GLTFRegistry(){let objects={};return{get:function(key$1){return objects[key$1]},add:function(key$1,object){objects[key$1]=object},remove:function(key$1){delete objects[key$1]},removeAll:function(){objects={}}}}const EXTENSIONS={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`};var GLTFLightsExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let parser=this.parser,nodeDefs=this.parser.json.nodes||[];for(let nodeIndex=0,nodeLength=nodeDefs.length;nodeIndex=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFTextureWebPExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_WEBP}loadTexture(textureIndex){let name$1=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name$1])return null;let extension$1=textureDef.extensions[name$1],source=json.images[extension$1.source],loader$1=parser.textureLoader;if(source.uri){let handler=parser.options.manager.getHandler(source.uri);handler!==null&&(loader$1=handler)}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFTextureAVIFExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_AVIF}loadTexture(textureIndex){let name$1=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name$1])return null;let extension$1=textureDef.extensions[name$1],source=json.images[extension$1.source],loader$1=parser.textureLoader;if(source.uri){let handler=parser.options.manager.getHandler(source.uri);handler!==null&&(loader$1=handler)}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFMeshoptCompression=class{constructor(parser){this.name=EXTENSIONS.EXT_MESHOPT_COMPRESSION,this.parser=parser}loadBufferView(index$1){let json=this.parser.json,bufferView=json.bufferViews[index$1];if(bufferView.extensions&&bufferView.extensions[this.name]){let extensionDef=bufferView.extensions[this.name],buffer=this.parser.getDependency(`buffer`,extensionDef.buffer),decoder=this.parser.options.meshoptDecoder;if(!decoder||!decoder.supported){if(json.extensionsRequired&&json.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return buffer.then(function(res){let byteOffset=extensionDef.byteOffset||0,byteLength=extensionDef.byteLength||0,count=extensionDef.count,stride=extensionDef.byteStride,source=new Uint8Array(res,byteOffset,byteLength);return decoder.decodeGltfBufferAsync?decoder.decodeGltfBufferAsync(count,stride,source,extensionDef.mode,extensionDef.filter).then(function(res$1){return res$1.buffer}):decoder.ready.then(function(){let result=new ArrayBuffer(count*stride);return decoder.decodeGltfBuffer(new Uint8Array(result),count,stride,source,extensionDef.mode,extensionDef.filter),result})})}else return null}},GLTFMeshGpuInstancing=class{constructor(parser){this.name=EXTENSIONS.EXT_MESH_GPU_INSTANCING,this.parser=parser}createNodeMesh(nodeIndex){let json=this.parser.json,nodeDef=json.nodes[nodeIndex];if(!nodeDef.extensions||!nodeDef.extensions[this.name]||nodeDef.mesh===void 0)return null;let meshDef=json.meshes[nodeDef.mesh];for(let primitive of meshDef.primitives)if(primitive.mode!==WEBGL_CONSTANTS.TRIANGLES&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_STRIP&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_FAN&&primitive.mode!==void 0)return null;let extensionDef=nodeDef.extensions[this.name],attributesDef=extensionDef.attributes,pending=[],attributes={};for(let key$1 in attributesDef)pending.push(this.parser.getDependency(`accessor`,attributesDef[key$1]).then(accessor=>(attributes[key$1]=accessor,attributes[key$1])));return pending.length<1?null:(pending.push(this.parser.createNodeMesh(nodeIndex)),Promise.all(pending).then(results=>{let nodeObject=results.pop(),meshes=nodeObject.isGroup?nodeObject.children:[nodeObject],count=results[0].count,instancedMeshes=[];for(let mesh of meshes){let m=new Matrix4,p$1=new Vector3,q=new Quaternion,s=new Vector3(1,1,1),instancedMesh=new InstancedMesh(mesh.geometry,mesh.material,count);for(let i=0;i0||uri.search(/^data\:image\/jpeg/)===0?`image/jpeg`:uri.search(/\.webp($|\?)/i)>0||uri.search(/^data\:image\/webp/)===0?`image/webp`:uri.search(/\.ktx2($|\?)/i)>0||uri.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}const _identityMatrix=new Matrix4;var GLTFParser=class{constructor(json={},options={}){this.json=json,this.extensions={},this.plugins={},this.options=options,this.cache=new GLTFRegistry,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let isSafari=!1,safariVersion=-1,isFirefox=!1,firefoxVersion=-1;if(typeof navigator<`u`){let userAgent=navigator.userAgent;isSafari=/^((?!chrome|android).)*safari/i.test(userAgent)===!0;let safariMatch=userAgent.match(/Version\/(\d+)/);safariVersion=isSafari&&safariMatch?parseInt(safariMatch[1],10):-1,isFirefox=userAgent.indexOf(`Firefox`)>-1,firefoxVersion=isFirefox?userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>`u`||isSafari&&safariVersion<17||isFirefox&&firefoxVersion<98?this.textureLoader=new TextureLoader(this.options.manager):this.textureLoader=new ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new FileLoader(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(extensions){this.extensions=extensions}setPlugins(plugins){this.plugins=plugins}parse(onLoad,onError){let parser=this,json=this.json,extensions=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(ext){return ext._markDefs&&ext._markDefs()}),Promise.all(this._invokeAll(function(ext){return ext.beforeRoot&&ext.beforeRoot()})).then(function(){return Promise.all([parser.getDependencies(`scene`),parser.getDependencies(`animation`),parser.getDependencies(`camera`)])}).then(function(dependencies){let result={scene:dependencies[0][json.scene||0],scenes:dependencies[0],animations:dependencies[1],cameras:dependencies[2],asset:json.asset,parser,userData:{}};return addUnknownExtensionsToUserData(extensions,result,json),assignExtrasToUserData(result,json),Promise.all(parser._invokeAll(function(ext){return ext.afterRoot&&ext.afterRoot(result)})).then(function(){for(let scene of result.scenes)scene.updateMatrixWorld();onLoad(result)})}).catch(onError)}_markDefs(){let nodeDefs=this.json.nodes||[],skinDefs=this.json.skins||[],meshDefs=this.json.meshes||[];for(let skinIndex=0,skinLength=skinDefs.length;skinIndex{let mappings=this.associations.get(original);mappings!=null&&this.associations.set(clone,mappings);for(let[i,child]of original.children.entries())updateMappings(child,clone.children[i])};return updateMappings(object,ref$1),ref$1.name+=`_instance_`+ cache.uses[index$1]++,ref$1}_invokeOne(func){let extensions=Object.values(this.plugins);extensions.push(this);for(let i=0;i=2&&bufferAttribute.setY(index$1,sparseValues[i*itemSize+1]),itemSize>=3&&bufferAttribute.setZ(index$1,sparseValues[i*itemSize+2]),itemSize>=4&&bufferAttribute.setW(index$1,sparseValues[i*itemSize+3]),itemSize>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}bufferAttribute.normalized=normalized}return bufferAttribute})}loadTexture(textureIndex){let json=this.json,options=this.options,textureDef=json.textures[textureIndex],sourceIndex=textureDef.source,sourceDef=json.images[sourceIndex],loader$1=this.textureLoader;if(sourceDef.uri){let handler=options.manager.getHandler(sourceDef.uri);handler!==null&&(loader$1=handler)}return this.loadTextureImage(textureIndex,sourceIndex,loader$1)}loadTextureImage(textureIndex,sourceIndex,loader$1){let parser=this,json=this.json,textureDef=json.textures[textureIndex],sourceDef=json.images[sourceIndex],cacheKey=(sourceDef.uri||sourceDef.bufferView)+`:`+textureDef.sampler;if(this.textureCache[cacheKey])return this.textureCache[cacheKey];let promise=this.loadImageSource(sourceIndex,loader$1).then(function(texture){texture.flipY=!1,texture.name=textureDef.name||sourceDef.name||``,texture.name===``&&typeof sourceDef.uri==`string`&&sourceDef.uri.startsWith(`data:image/`)===!1&&(texture.name=sourceDef.uri);let samplers=json.samplers||{},sampler=samplers[textureDef.sampler]||{};return texture.magFilter=WEBGL_FILTERS[sampler.magFilter]||LinearFilter,texture.minFilter=WEBGL_FILTERS[sampler.minFilter]||LinearMipmapLinearFilter,texture.wrapS=WEBGL_WRAPPINGS[sampler.wrapS]||RepeatWrapping,texture.wrapT=WEBGL_WRAPPINGS[sampler.wrapT]||RepeatWrapping,texture.generateMipmaps=!texture.isCompressedTexture&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter,parser.associations.set(texture,{textures:textureIndex}),texture}).catch(function(){return null});return this.textureCache[cacheKey]=promise,promise}loadImageSource(sourceIndex,loader$1){let parser=this,json=this.json,options=this.options;if(this.sourceCache[sourceIndex]!==void 0)return this.sourceCache[sourceIndex].then(texture=>texture.clone());let sourceDef=json.images[sourceIndex],URL$1=self.URL||self.webkitURL,sourceURI=sourceDef.uri||``,isObjectURL=!1;if(sourceDef.bufferView!==void 0)sourceURI=parser.getDependency(`bufferView`,sourceDef.bufferView).then(function(bufferView){isObjectURL=!0;let blob=new Blob([bufferView],{type:sourceDef.mimeType});return sourceURI=URL$1.createObjectURL(blob),sourceURI});else if(sourceDef.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+sourceIndex+` is missing URI and bufferView`);let promise=Promise.resolve(sourceURI).then(function(sourceURI$1){return new Promise(function(resolve,reject){let onLoad=resolve;loader$1.isImageBitmapLoader===!0&&(onLoad=function(imageBitmap){let texture=new Texture(imageBitmap);texture.needsUpdate=!0,resolve(texture)}),loader$1.load(LoaderUtils.resolveURL(sourceURI$1,options.path),onLoad,void 0,reject)})}).then(function(texture){return isObjectURL===!0&&URL$1.revokeObjectURL(sourceURI),assignExtrasToUserData(texture,sourceDef),texture.userData.mimeType=sourceDef.mimeType||getImageURIMimeType(sourceDef.uri),texture}).catch(function(error){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,sourceURI),error});return this.sourceCache[sourceIndex]=promise,promise}assignTexture(materialParams,mapName,mapDef,colorSpace){let parser=this;return this.getDependency(`texture`,mapDef.index).then(function(texture){if(!texture)return null;if(mapDef.texCoord!==void 0&&mapDef.texCoord>0&&(texture=texture.clone(),texture.channel=mapDef.texCoord),parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]){let transform=mapDef.extensions===void 0?void 0:mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM];if(transform){let gltfReference=parser.associations.get(texture);texture=parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture,transform),parser.associations.set(texture,gltfReference)}}return colorSpace!==void 0&&(texture.colorSpace=colorSpace),materialParams[mapName]=texture,texture})}assignFinalMaterial(mesh){let geometry=mesh.geometry,material=mesh.material,useDerivativeTangents=geometry.attributes.tangent===void 0,useVertexColors=geometry.attributes.color!==void 0,useFlatShading=geometry.attributes.normal===void 0;if(mesh.isPoints){let cacheKey=`PointsMaterial:`+material.uuid,pointsMaterial=this.cache.get(cacheKey);pointsMaterial||(pointsMaterial=new PointsMaterial,Material.prototype.copy.call(pointsMaterial,material),pointsMaterial.color.copy(material.color),pointsMaterial.map=material.map,pointsMaterial.sizeAttenuation=!1,this.cache.add(cacheKey,pointsMaterial)),material=pointsMaterial}else if(mesh.isLine){let cacheKey=`LineBasicMaterial:`+material.uuid,lineMaterial=this.cache.get(cacheKey);lineMaterial||(lineMaterial=new LineBasicMaterial,Material.prototype.copy.call(lineMaterial,material),lineMaterial.color.copy(material.color),lineMaterial.map=material.map,this.cache.add(cacheKey,lineMaterial)),material=lineMaterial}if(useDerivativeTangents||useVertexColors||useFlatShading){let cacheKey=`ClonedMaterial:`+material.uuid+`:`;useDerivativeTangents&&(cacheKey+=`derivative-tangents:`),useVertexColors&&(cacheKey+=`vertex-colors:`),useFlatShading&&(cacheKey+=`flat-shading:`);let cachedMaterial=this.cache.get(cacheKey);cachedMaterial||(cachedMaterial=material.clone(),useVertexColors&&(cachedMaterial.vertexColors=!0),useFlatShading&&(cachedMaterial.flatShading=!0),useDerivativeTangents&&(cachedMaterial.normalScale&&(cachedMaterial.normalScale.y*=-1),cachedMaterial.clearcoatNormalScale&&(cachedMaterial.clearcoatNormalScale.y*=-1)),this.cache.add(cacheKey,cachedMaterial),this.associations.set(cachedMaterial,this.associations.get(material))),material=cachedMaterial}mesh.material=material}getMaterialType(){return MeshStandardMaterial}loadMaterial(materialIndex){let parser=this,json=this.json,extensions=this.extensions,materialDef=json.materials[materialIndex],materialType,materialParams={},materialExtensions=materialDef.extensions||{},pending=[];if(materialExtensions[EXTENSIONS.KHR_MATERIALS_UNLIT]){let kmuExtension=extensions[EXTENSIONS.KHR_MATERIALS_UNLIT];materialType=kmuExtension.getMaterialType(),pending.push(kmuExtension.extendParams(materialParams,materialDef,parser))}else{let metallicRoughness=materialDef.pbrMetallicRoughness||{};if(materialParams.color=new Color(1,1,1),materialParams.opacity=1,Array.isArray(metallicRoughness.baseColorFactor)){let array=metallicRoughness.baseColorFactor;materialParams.color.setRGB(array[0],array[1],array[2],LinearSRGBColorSpace),materialParams.opacity=array[3]}metallicRoughness.baseColorTexture!==void 0&&pending.push(parser.assignTexture(materialParams,`map`,metallicRoughness.baseColorTexture,SRGBColorSpace)),materialParams.metalness=metallicRoughness.metallicFactor===void 0?1:metallicRoughness.metallicFactor,materialParams.roughness=metallicRoughness.roughnessFactor===void 0?1:metallicRoughness.roughnessFactor,metallicRoughness.metallicRoughnessTexture!==void 0&&(pending.push(parser.assignTexture(materialParams,`metalnessMap`,metallicRoughness.metallicRoughnessTexture)),pending.push(parser.assignTexture(materialParams,`roughnessMap`,metallicRoughness.metallicRoughnessTexture))),materialType=this._invokeOne(function(ext){return ext.getMaterialType&&ext.getMaterialType(materialIndex)}),pending.push(Promise.all(this._invokeAll(function(ext){return ext.extendMaterialParams&&ext.extendMaterialParams(materialIndex,materialParams)})))}materialDef.doubleSided===!0&&(materialParams.side=DoubleSide);let alphaMode=materialDef.alphaMode||ALPHA_MODES.OPAQUE;if(alphaMode===ALPHA_MODES.BLEND?(materialParams.transparent=!0,materialParams.depthWrite=!1):(materialParams.transparent=!1,alphaMode===ALPHA_MODES.MASK&&(materialParams.alphaTest=materialDef.alphaCutoff===void 0?.5:materialDef.alphaCutoff)),materialDef.normalTexture!==void 0&&materialType!==MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,`normalMap`,materialDef.normalTexture)),materialParams.normalScale=new Vector2(1,1),materialDef.normalTexture.scale!==void 0)){let scale=materialDef.normalTexture.scale;materialParams.normalScale.set(scale,scale)}if(materialDef.occlusionTexture!==void 0&&materialType!==MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,`aoMap`,materialDef.occlusionTexture)),materialDef.occlusionTexture.strength!==void 0&&(materialParams.aoMapIntensity=materialDef.occlusionTexture.strength)),materialDef.emissiveFactor!==void 0&&materialType!==MeshBasicMaterial){let emissiveFactor=materialDef.emissiveFactor;materialParams.emissive=new Color().setRGB(emissiveFactor[0],emissiveFactor[1],emissiveFactor[2],LinearSRGBColorSpace)}return materialDef.emissiveTexture!==void 0&&materialType!==MeshBasicMaterial&&pending.push(parser.assignTexture(materialParams,`emissiveMap`,materialDef.emissiveTexture,SRGBColorSpace)),Promise.all(pending).then(function(){let material=new materialType(materialParams);return materialDef.name&&(material.name=materialDef.name),assignExtrasToUserData(material,materialDef),parser.associations.set(material,{materials:materialIndex}),materialDef.extensions&&addUnknownExtensionsToUserData(extensions,material,materialDef),material})}createUniqueName(originalName){let sanitizedName=PropertyBinding.sanitizeNodeName(originalName||``);return sanitizedName in this.nodeNamesUsed?sanitizedName+`_`+ ++this.nodeNamesUsed[sanitizedName]:(this.nodeNamesUsed[sanitizedName]=0,sanitizedName)}loadGeometries(primitives){let parser=this,extensions=this.extensions,cache=this.primitiveCache;function createDracoPrimitive(primitive){return extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(primitive,parser).then(function(geometry){return addPrimitiveAttributes(geometry,primitive,parser)})}let pending=[];for(let i=0,il=primitives.length;i0&&updateMorphTargets(mesh,meshDef),mesh.name=parser.createUniqueName(meshDef.name||`mesh_`+meshIndex),assignExtrasToUserData(mesh,meshDef),primitive.extensions&&addUnknownExtensionsToUserData(extensions,mesh,primitive),parser.assignFinalMaterial(mesh),meshes.push(mesh)}for(let i=0,il=meshes.length;i1?new Group:objects.length===1?objects[0]:new Object3D,node$1!==objects[0])for(let i=0,il=objects.length;i1){let mapping=parser.associations.get(node$1);parser.associations.set(node$1,{...mapping})}return parser.associations.get(node$1).nodes=nodeIndex,node$1}),this.nodeCache[nodeIndex]}loadScene(sceneIndex){let extensions=this.extensions,sceneDef=this.json.scenes[sceneIndex],parser=this,scene=new Group;sceneDef.name&&(scene.name=parser.createUniqueName(sceneDef.name)),assignExtrasToUserData(scene,sceneDef),sceneDef.extensions&&addUnknownExtensionsToUserData(extensions,scene,sceneDef);let nodeIds=sceneDef.nodes||[],pending=[];for(let i=0,il=nodeIds.length;i{let reducedAssociations=new Map;for(let[key$1,value]of parser.associations)(key$1 instanceof Material||key$1 instanceof Texture)&&reducedAssociations.set(key$1,value);return node$1.traverse(node$2=>{let mappings=parser.associations.get(node$2);mappings!=null&&reducedAssociations.set(node$2,mappings)}),reducedAssociations};return parser.associations=reduceAssociations(scene),scene})}_createAnimationTracks(node$1,inputAccessor,outputAccessor,sampler,target){let tracks=[],targetName=node$1.name?node$1.name:node$1.uuid,targetNames=[];PATH_PROPERTIES[target.path]===PATH_PROPERTIES.weights?node$1.traverse(function(object){object.morphTargetInfluences&&targetNames.push(object.name?object.name:object.uuid)}):targetNames.push(targetName);let TypedKeyframeTrack;switch(PATH_PROPERTIES[target.path]){case PATH_PROPERTIES.weights:TypedKeyframeTrack=NumberKeyframeTrack;break;case PATH_PROPERTIES.rotation:TypedKeyframeTrack=QuaternionKeyframeTrack;break;case PATH_PROPERTIES.translation:case PATH_PROPERTIES.scale:TypedKeyframeTrack=VectorKeyframeTrack;break;default:switch(outputAccessor.itemSize){case 1:TypedKeyframeTrack=NumberKeyframeTrack;break;case 2:case 3:default:TypedKeyframeTrack=VectorKeyframeTrack;break}break}let interpolation=sampler.interpolation===void 0?InterpolateLinear:INTERPOLATION[sampler.interpolation],outputArray=this._getArrayFromAccessor(outputAccessor);for(let j=0,jl=targetNames.length;jnew VRMLoaderPlugin(parser)),loader.register(parser=>new VRMAnimationLoaderPlugin(parser)),loader)}async function loadVRMAnimation(url){let loader$1=useVRMLoader(),gltf=await loader$1.loadAsync(url),userData=gltf.userData;if(!userData.vrmAnimations){console.warn(`No VRM animations found in the .vrma file`);return}if(userData.vrmAnimations.length===0){console.warn(`No VRM animations found in the .vrma file`);return}return userData.vrmAnimations[0]}async function clipFromVRMAnimation(vrm,animation){if(!vrm){console.warn(`No VRM found`);return}if(animation)return createVRMAnimationClip(animation,vrm)}function useBlink(){let isBlinking=ref(!1),blinkProgress=ref(0),timeSinceLastBlink=ref(0),BLINK_DURATION=.2,MIN_BLINK_INTERVAL=1,MAX_BLINK_INTERVAL=6,nextBlinkTime=ref(Math.random()*(MAX_BLINK_INTERVAL-MIN_BLINK_INTERVAL)+MIN_BLINK_INTERVAL);function update(vrm,delta){if(vrm?.expressionManager&&(timeSinceLastBlink.value+=delta,!isBlinking.value&&timeSinceLastBlink.value>=nextBlinkTime.value&&(isBlinking.value=!0,blinkProgress.value=0),isBlinking.value)){blinkProgress.value+=delta/BLINK_DURATION;let blinkValue=Math.sin(Math.PI*blinkProgress.value);vrm.expressionManager.setValue(`blink`,blinkValue),blinkProgress.value>=1&&(isBlinking.value=!1,timeSinceLastBlink.value=0,vrm.expressionManager.setValue(`blink`,0),nextBlinkTime.value=Math.random()*(MAX_BLINK_INTERVAL-MIN_BLINK_INTERVAL)+MIN_BLINK_INTERVAL)}}return{update}}function useIdleEyeSaccades(){let nextSaccadeAfter=-1,fixationTarget,timeSinceLastSaccade=0;function updateFixationTarget(){fixationTarget?fixationTarget.set(randFloat(-.25,.25),randFloat(-.2,.15),-.65):fixationTarget=new Vector3(randFloat(-.25,.25),randFloat(-.2,.15),-.65)}function update(vrm,delta){var _vrm$lookAt;!vrm?.expressionManager||!vrm.lookAt||(timeSinceLastSaccade>=nextSaccadeAfter?(updateFixationTarget(),timeSinceLastSaccade=0,nextSaccadeAfter=randomSaccadeInterval()/1e3):fixationTarget||updateFixationTarget(),vrm.lookAt.target||(vrm.lookAt.target=new Object3D),vrm.lookAt.target.position.lerp(fixationTarget,randFloat(.2,.5)),(_vrm$lookAt=vrm.lookAt)?.update(delta),timeSinceLastSaccade+=delta)}return{update}}async function loadVrm(model,options){let loader$1=useVRMLoader(),gltf=await loader$1.loadAsync(model,progress=>{var _options$onProgress;return options==null||(_options$onProgress=options.onProgress)==null?void 0:_options$onProgress.call(options,progress)}),userData=gltf.userData;if(!userData.vrm)return;let _vrm=userData.vrm;if(VRMUtils.removeUnnecessaryVertices(_vrm.scene),VRMUtils.combineSkeletons(_vrm.scene),_vrm.scene.traverse(object=>{object.frustumCulled=!1}),options?.lookAt&&_vrm.lookAt){let lookAtQuatProxy=new VRMLookAtQuaternionProxy(_vrm.lookAt);lookAtQuatProxy.name=`lookAtQuaternionProxy`,_vrm.scene.add(lookAtQuatProxy)}return options?.scene&&options.scene.add(_vrm.scene),options?.position&&_vrm.scene.position.set(...options.position),_vrm}function useVRMEmote(vrm){let currentEmotion=ref(null),isTransitioning=ref(!1),transitionProgress=ref(0),currentExpressionValues=ref(new Map),targetExpressionValues=ref(new Map),resetTimeout=ref(),lerp$1=(start,end,t)=>start+(end-start)*t,easeInOutCubic=t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2,emotionStates=new Map([[`happy`,{expression:[{name:`happy`,value:1,duration:.3},{name:`aa`,value:.3}],blendDuration:.3}],[`sad`,{expression:[{name:`sad`,value:1},{name:`oh`,value:.2}],blendDuration:.3}],[`angry`,{expression:[{name:`angry`,value:1},{name:`ee`,value:.4}],blendDuration:.2}],[`surprised`,{expression:[{name:`Surprised`,value:1},{name:`oh`,value:.6}],blendDuration:.1}],[`neutral`,{expression:[{name:`neutral`,value:1}],blendDuration:.5}]]),clearResetTimeout=()=>{resetTimeout.value&&(clearTimeout(resetTimeout.value),resetTimeout.value=void 0)},setEmotion=emotionName=>{if(clearResetTimeout(),!emotionStates.has(emotionName)){console.warn(`Emotion ${emotionName} not found`);return}let emotionState=emotionStates.get(emotionName);if(currentEmotion.value=emotionName,isTransitioning.value=!0,transitionProgress.value=0,vrm.expressionManager){let expressionNames=Object.keys(vrm.expressionManager.expressionMap);for(let name$1 of expressionNames)vrm.expressionManager.setValue(name$1,0)}currentExpressionValues.value.clear(),targetExpressionValues.value.clear();for(let expr of emotionState.expression||[]){var _vrm$expressionManage;let currentValue=(_vrm$expressionManage=vrm.expressionManager)?.getValue(expr.name)||0;currentExpressionValues.value.set(expr.name,currentValue),targetExpressionValues.value.set(expr.name,expr.value)}},setEmotionWithResetAfter=(emotionName,ms)=>{clearResetTimeout(),setEmotion(emotionName),resetTimeout.value=setTimeout(()=>{setEmotion(`neutral`),resetTimeout.value=void 0},ms)},update=deltaTime=>{if(!isTransitioning.value||!currentEmotion.value)return;let emotionState=emotionStates.get(currentEmotion.value),blendDuration=emotionState.blendDuration||.3;transitionProgress.value+=deltaTime/blendDuration,transitionProgress.value>=1&&(transitionProgress.value=1,isTransitioning.value=!1);for(let[exprName,targetValue]of targetExpressionValues.value){var _vrm$expressionManage2;let startValue=currentExpressionValues.value.get(exprName)||0,currentValue=lerp$1(startValue,targetValue,easeInOutCubic(transitionProgress.value));(_vrm$expressionManage2=vrm.expressionManager)?.setValue(exprName,currentValue)}},addEmotionState=(emotionName,state)=>{emotionStates.set(emotionName,state)},removeEmotionState=emotionName=>{emotionStates.delete(emotionName)},dispose$1=()=>{clearResetTimeout()};return{currentEmotion,isTransitioning,setEmotion,setEmotionWithResetAfter,update,addEmotionState,removeEmotionState,dispose:dispose$1}}function useWhisper(url,options){let opts=merge({onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}},options),{post:whisperPost,data:whisperData,terminate}=useWebWorker(url,{type:`module`}),status=ref(null),loadingMessage=ref(``),loadingProgress=ref([]),transcribing=ref(!1),tps=ref(0),result=ref(``);return watch(whisperData,e=>{switch(e.status){case`loading`:var _opts$onLoading;status.value=`loading`,loadingMessage.value=e.data,(_opts$onLoading=opts.onLoading)?.call(opts,e.data);break;case`initiate`:var _opts$onInitiate;loadingProgress.value.push(e),(_opts$onInitiate=opts.onInitiate)?.call(opts,e);break;case`progress`:var _opts$onProgress;loadingProgress.value=loadingProgress.value.map(item=>item.file===e.file?{...item,...e}:item),(_opts$onProgress=opts.onProgress)?.call(opts,e);break;case`done`:var _opts$onDone;loadingProgress.value=loadingProgress.value.filter(item=>item.file!==e.file),(_opts$onDone=opts.onDone)?.call(opts,e);break;case`ready`:var _opts$onReady;status.value=`ready`,(_opts$onReady=opts.onReady)?.call(opts);break;case`start`:var _opts$onStart;transcribing.value=!0,(_opts$onStart=opts.onStart)?.call(opts);break;case`update`:var _opts$onUpdate;tps.value=e.tps,(_opts$onUpdate=opts.onUpdate)?.call(opts,e.tps);break;case`complete`:var _opts$onComplete;transcribing.value=!1,result.value=e.output[0]||``,console.debug(`Whisper result:`,result.value),(_opts$onComplete=opts.onComplete)?.call(opts,e.output[0]);break}}),onUnmounted(()=>{terminate()}),{transcribe:message=>whisperPost(message),status,loadingMessage,loadingProgress,transcribing,tps,result,load:()=>whisperPost({type:`load`}),terminate}}export{VRMUtils,ccount,clipFromVRMAnimation,lerp,loadVRMAnimation,loadVrm,randFloat,randomSaccadeInterval,stringifyEntitiesLight,useBlink,useIdleEyeSaccades,useLlmmarkerParser,useMarkdown,useMicVAD,useVRMEmote,useWhisper}; \ No newline at end of file diff --git a/assets/consciousness-NuFD6MD2.js b/assets/consciousness-DGt-Az-C.js similarity index 94% rename from assets/consciousness-NuFD6MD2.js rename to assets/consciousness-DGt-Az-C.js index b0e15b404810f7f8d9ec4c9776f37bcd25b9da68..c6f9833f85a8fe012c3a152c0f65dc4225887fdb 100644 --- a/assets/consciousness-NuFD6MD2.js +++ b/assets/consciousness-DGt-Az-C.js @@ -1 +1 @@ -import{Fragment as e,RouterLink as t,createBaseVNode as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createVNode as ee,defineComponent as o,isRef as s,onMounted as c,openBlock as l,renderList as te,resolveDirective as ne,storeToRefs as u,toDisplayString as d,unref as f,useI18n as re,vModelText as ie,withCtx as ae,withDirectives as p}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useConsciousnessStore as oe,useProvidersStore as se}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{RadioCardManySelect_default as ce,RadioCardSimple_default as le}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as m}from"./route-block-CC3cgg4Q.js";const h={bg:`neutral-50 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},g={flex:`~ col gap-4`},_={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},v={text:`neutral-400 dark:neutral-400`},y={"max-w-full":``},b={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},x={key:1},S={key:0},C={flex:`~ col gap-4`},w={class:`text-lg md:text-2xl`},T={text:`neutral-400 dark:neutral-400`},E={key:0,class:`flex items-center justify-center py-4`},D={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`},O={class:`flex flex-col`},k={class:`font-medium`},A={class:`text-sm text-red-600 dark:text-red-400`},j={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`},M={class:`flex flex-col`},N={class:`font-medium`},P={class:`text-sm text-amber-600 dark:text-amber-400`},ue={key:1},F={flex:`~ col gap-4`},I={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},L={text:`neutral-400 dark:neutral-500`},R={class:`flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20`},z={class:`flex flex-col`},B={class:`font-medium`},V={class:`text-sm text-primary-600 dark:text-primary-400`},H={class:`mt-2`},U={class:`mb-1 block text-sm font-medium`},de=[`placeholder`],fe={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var W=o({__name:`consciousness`,setup(o){let m=se(),W=oe(),{configuredChatProvidersMetadata:G}=u(m),{activeProvider:K,activeModel:q,customModelName:pe,modelSearchQuery:J,supportsModelListing:Y,providerModels:X,isLoadingActiveProviderModels:Z,activeProviderModelError:Q}=u(W),{t:$}=re();c(async()=>{await W.loadModelsForProvider(K.value)});function me(e){pe.value=e}return(o,c)=>{let u=ne(`motion`);return l(),a(e,null,[n(`div`,h,[n(`div`,null,[n(`div`,g,[n(`div`,null,[n(`h2`,_,d(f($)(`settings.pages.providers.title`)),1),n(`div`,v,[n(`span`,null,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.description`)),1)])]),n(`div`,y,[f(G).length>0?(l(),a(`fieldset`,b,[(l(!0),a(e,null,te(f(G),e=>(l(),r(f(le),{id:e.id,key:e.id,modelValue:f(K),"onUpdate:modelValue":c[0]||=e=>s(K)?K.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(l(),a(`div`,x,[ee(f(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:ae(()=>c[4]||=[n(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,{class:`flex flex-col`},[n(`span`,{class:`font-medium`},`No Providers Configured`),n(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your LLM providers`)],-1),n(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[4]})]))])])]),f(K)&&f(Y)?(l(),a(`div`,S,[n(`div`,C,[n(`div`,null,[n(`h2`,w,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),n(`div`,T,[n(`span`,null,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),f(Z)?(l(),a(`div`,E,[c[5]||=n(`div`,{class:`mr-2 animate-spin`},[n(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),n(`span`,null,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):f(Q)?(l(),a(`div`,D,[c[6]||=n(`div`,{"i-solar:close-circle-line-duotone":``,class:`text-2xl text-red-500 dark:text-red-400`},null,-1),n(`div`,O,[n(`span`,k,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`)),1),n(`span`,A,d(f(Q)),1)])])):f(X).length===0&&!f(Z)?(l(),a(`div`,j,[c[7]||=n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,M,[n(`span`,N,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1),n(`span`,P,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)])])):f(X).length>0?(l(),r(f(ce),{key:3,modelValue:f(q),"onUpdate:modelValue":c[1]||=e=>s(q)?q.value=e:null,"search-query":f(J),"onUpdate:searchQuery":c[2]||=e=>s(J)?J.value=e:null,items:f(X).sort((e,t)=>e.id===f(q)?-1:t.id===f(q)?1:0),searchable:!0,"search-placeholder":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:f(J)}),"search-results-text":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":me},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`])):i(``,!0)])])):f(K)&&!f(Y)?(l(),a(`div`,ue,[n(`div`,F,[n(`div`,null,[n(`h2`,I,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),n(`div`,L,[n(`span`,null,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),n(`div`,R,[c[8]||=n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-primary-500 dark:text-primary-400`},null,-1),n(`div`,z,[n(`span`,B,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported`)),1),n(`span`,V,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description`)),1)])]),n(`div`,H,[n(`label`,U,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`)),1),p(n(`input`,{"onUpdate:modelValue":c[3]||=e=>s(q)?q.value=e:null,type:`text`,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`,placeholder:f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,de),[[ie,f(q)]])])])])):i(``,!0)]),p((l(),a(`div`,fe,c[9]||=[n(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)])),[[u]])],64)}}});typeof m==`function`&&m(W);var G=W;export{G as default}; \ No newline at end of file +import{Fragment as e,RouterLink as t,createBaseVNode as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createVNode as ee,defineComponent as o,isRef as s,onMounted as c,openBlock as l,renderList as te,resolveDirective as ne,storeToRefs as u,toDisplayString as d,unref as f,useI18n as re,vModelText as ie,withCtx as ae,withDirectives as p}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useConsciousnessStore as oe,useProvidersStore as se}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{RadioCardManySelect_default as ce,RadioCardSimple_default as le}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as m}from"./route-block-CC3cgg4Q.js";const h={bg:`neutral-50 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},g={flex:`~ col gap-4`},_={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},v={text:`neutral-400 dark:neutral-400`},y={"max-w-full":``},b={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},x={key:1},S={key:0},C={flex:`~ col gap-4`},w={class:`text-lg md:text-2xl`},T={text:`neutral-400 dark:neutral-400`},E={key:0,class:`flex items-center justify-center py-4`},D={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`},O={class:`flex flex-col`},k={class:`font-medium`},A={class:`text-sm text-red-600 dark:text-red-400`},j={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`},M={class:`flex flex-col`},N={class:`font-medium`},P={class:`text-sm text-amber-600 dark:text-amber-400`},ue={key:1},F={flex:`~ col gap-4`},I={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},L={text:`neutral-400 dark:neutral-500`},R={class:`flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20`},z={class:`flex flex-col`},B={class:`font-medium`},V={class:`text-sm text-primary-600 dark:text-primary-400`},H={class:`mt-2`},U={class:`mb-1 block text-sm font-medium`},de=[`placeholder`],fe={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var W=o({__name:`consciousness`,setup(o){let m=se(),W=oe(),{configuredChatProvidersMetadata:G}=u(m),{activeProvider:K,activeModel:q,customModelName:pe,modelSearchQuery:J,supportsModelListing:Y,providerModels:X,isLoadingActiveProviderModels:Z,activeProviderModelError:Q}=u(W),{t:$}=re();c(async()=>{await W.loadModelsForProvider(K.value)});function me(e){pe.value=e}return(o,c)=>{let u=ne(`motion`);return l(),a(e,null,[n(`div`,h,[n(`div`,null,[n(`div`,g,[n(`div`,null,[n(`h2`,_,d(f($)(`settings.pages.providers.title`)),1),n(`div`,v,[n(`span`,null,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.description`)),1)])]),n(`div`,y,[f(G).length>0?(l(),a(`fieldset`,b,[(l(!0),a(e,null,te(f(G),e=>(l(),r(f(le),{id:e.id,key:e.id,modelValue:f(K),"onUpdate:modelValue":c[0]||=e=>s(K)?K.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(l(),a(`div`,x,[ee(f(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:ae(()=>c[4]||=[n(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,{class:`flex flex-col`},[n(`span`,{class:`font-medium`},`No Providers Configured`),n(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your LLM providers`)],-1),n(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[4]})]))])])]),f(K)&&f(Y)?(l(),a(`div`,S,[n(`div`,C,[n(`div`,null,[n(`h2`,w,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),n(`div`,T,[n(`span`,null,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),f(Z)?(l(),a(`div`,E,[c[5]||=n(`div`,{class:`mr-2 animate-spin`},[n(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),n(`span`,null,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):f(Q)?(l(),a(`div`,D,[c[6]||=n(`div`,{"i-solar:close-circle-line-duotone":``,class:`text-2xl text-red-500 dark:text-red-400`},null,-1),n(`div`,O,[n(`span`,k,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`)),1),n(`span`,A,d(f(Q)),1)])])):f(X).length===0&&!f(Z)?(l(),a(`div`,j,[c[7]||=n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,M,[n(`span`,N,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1),n(`span`,P,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)])])):f(X).length>0?(l(),r(f(ce),{key:3,modelValue:f(q),"onUpdate:modelValue":c[1]||=e=>s(q)?q.value=e:null,"search-query":f(J),"onUpdate:searchQuery":c[2]||=e=>s(J)?J.value=e:null,items:f(X).sort((e,t)=>e.id===f(q)?-1:t.id===f(q)?1:0),searchable:!0,"search-placeholder":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:f(J)}),"search-results-text":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":me},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`])):i(``,!0)])])):f(K)&&!f(Y)?(l(),a(`div`,ue,[n(`div`,F,[n(`div`,null,[n(`h2`,I,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),n(`div`,L,[n(`span`,null,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),n(`div`,R,[c[8]||=n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-primary-500 dark:text-primary-400`},null,-1),n(`div`,z,[n(`span`,B,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported`)),1),n(`span`,V,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description`)),1)])]),n(`div`,H,[n(`label`,U,d(f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`)),1),p(n(`input`,{"onUpdate:modelValue":c[3]||=e=>s(q)?q.value=e:null,type:`text`,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`,placeholder:f($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,de),[[ie,f(q)]])])])])):i(``,!0)]),p((l(),a(`div`,fe,c[9]||=[n(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)])),[[u]])],64)}}});typeof m==`function`&&m(W);var G=W;export{G as default}; \ No newline at end of file diff --git a/assets/deepseek-BqMiLukk.js b/assets/deepseek-BzDEswlr.js similarity index 82% rename from assets/deepseek-BqMiLukk.js rename to assets/deepseek-BzDEswlr.js index 5e064b609177178f5316a42829a4b4f2c320383a..4b59fe734c61d67263e2dfa1c31f248164bffbfc 100644 --- a/assets/deepseek-BqMiLukk.js +++ b/assets/deepseek-BzDEswlr.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`deepseek`;var x=r({__name:`deepseek`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon-color":(o=w.value)?.iconColor,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.deepseek.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`deepseek`;var x=r({__name:`deepseek`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon-color":(o=w.value)?.iconColor,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.deepseek.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/default-node-G9zSbWb2.js b/assets/default-node-q82Mf43j.js similarity index 59% rename from assets/default-node-G9zSbWb2.js rename to assets/default-node-q82Mf43j.js index 7b64927840548cba826a706401c35507a446eb6c..6fba6ec6fa11d1cf984c017d498c4a90ceffef59 100644 --- a/assets/default-node-G9zSbWb2.js +++ b/assets/default-node-q82Mf43j.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-CubORAmj.js","assets/__vite-browser-external-CoPuN2cl.js","assets/index-BSwg6FIo.js","assets/index-5P7QcyEX.css"])))=>i.map(i=>d[i]); -import{__toDynamicImportESM as e,__vitePreload as t}from"./index-BSwg6FIo.js";async function n(){let{createRequire:n}=await t(async()=>{let{createRequire:t}=await import(`./__vite-browser-external-CubORAmj.js`).then(e(1));return{createRequire:t}},__vite__mapDeps([0,1,2,3])),{dirname:r,resolve:i}=await t(async()=>{let{dirname:t,resolve:n}=await import(`./__vite-browser-external-CubORAmj.js`).then(e(1));return{dirname:t,resolve:n}},__vite__mapDeps([0,1,2,3])),a=n(import.meta.url),o=r(a.resolve(`@duckdb/duckdb-wasm`));return{mvp:{mainModule:i(o,`./duckdb-mvp.wasm`),mainWorker:i(o,`./duckdb-node-mvp.worker.cjs`)},eh:{mainModule:i(o,`./duckdb-eh.wasm`),mainWorker:i(o,`./duckdb-node-eh.worker.cjs`)}}}export{n as getBundles}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-Dxcx6a0k.js","assets/__vite-browser-external-FU9M8lFq.js","assets/index-DKziOBM4.js","assets/index-5P7QcyEX.css"])))=>i.map(i=>d[i]); +import{__toDynamicImportESM as e,__vitePreload as t}from"./index-DKziOBM4.js";async function n(){let{createRequire:n}=await t(async()=>{let{createRequire:t}=await import(`./__vite-browser-external-Dxcx6a0k.js`).then(e(1));return{createRequire:t}},__vite__mapDeps([0,1,2,3])),{dirname:r,resolve:i}=await t(async()=>{let{dirname:t,resolve:n}=await import(`./__vite-browser-external-Dxcx6a0k.js`).then(e(1));return{dirname:t,resolve:n}},__vite__mapDeps([0,1,2,3])),a=n(import.meta.url),o=r(a.resolve(`@duckdb/duckdb-wasm`));return{mvp:{mainModule:i(o,`./duckdb-mvp.wasm`),mainWorker:i(o,`./duckdb-node-mvp.worker.cjs`)},eh:{mainModule:i(o,`./duckdb-eh.wasm`),mainWorker:i(o,`./duckdb-node-eh.worker.cjs`)}}}export{n as getBundles}; \ No newline at end of file diff --git a/assets/default-Db8QsuAx.js b/assets/default-xnAH3KmJ.js similarity index 82% rename from assets/default-Db8QsuAx.js rename to assets/default-xnAH3KmJ.js index 69bad767e47c2773b62f324a0bd93f07d21f31f6..57f9de88cba8815b1092c37690ac1622efb3fc7e 100644 --- a/assets/default-Db8QsuAx.js +++ b/assets/default-xnAH3KmJ.js @@ -1 +1 @@ -import{RouterView as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,unref as o}from"./index-BSwg6FIo.js";import{HeaderLink_default as s}from"./HeaderLink-rfbghXs_.js";const c={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`}},l={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},u={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"mx-auto":``,"max-w-screen-xl":``};var d=i({__name:`default`,setup(i){return(i,d)=>(a(),n(`div`,c,[t(`div`,l,[r(s)]),t(`div`,u,[r(o(e))])]))}}),f=d;export{f as default}; \ No newline at end of file +import{RouterView as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,unref as o}from"./index-DKziOBM4.js";import{HeaderLink_default as s}from"./HeaderLink-vGMDgqa7.js";const c={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`}},l={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},u={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"mx-auto":``,"max-w-screen-xl":``};var d=i({__name:`default`,setup(i){return(i,d)=>(a(),n(`div`,c,[t(`div`,l,[r(s)]),t(`div`,u,[r(o(e))])]))}}),f=d;export{f as default}; \ No newline at end of file diff --git a/assets/delays-DVvIZeUS.js b/assets/delays-DFcn4gRF.js similarity index 77% rename from assets/delays-DVvIZeUS.js rename to assets/delays-DFcn4gRF.js index 52746d6c33f5a25aeffcd079cf498c32fb7776e9..3f426aa2683480e1fb99b1e561ff5adc3604b004 100644 --- a/assets/delays-DVvIZeUS.js +++ b/assets/delays-DFcn4gRF.js @@ -1 +1 @@ -import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,ref as o,renderList as s,toDisplayString as c,unref as l}from"./index-BSwg6FIo.js";import"./src-CX9nVT7I.js";import"./Basic-BGRWPjtG.js";import{Textarea_default as u}from"./Textarea-CuugR8VV.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import{llmInferenceEndToken as d,useDelayMessageQueue as f}from"./queues-XZuprNy-.js";const p={flex:``,"flex-col":``,"gap-2":``,"p-2":``},m={flex:``,"flex-row":``,"gap-2":``},h={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},g={"w-full":``,flex:``,"flex-row":``,"gap-4":``},_={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=i({__name:`delays`,setup(i){let y=o(``),b=o([]),x=o([]),S=o(!1),C=f();C.onHandlerEvent(`delay`,e=>{x.value.push(e)});function w(){S.value=!0;let e=y.value.split(``);for(let t of e)C.add(t);C.add(d),y.value=``,S.value=!1}return(i,o)=>(a(),n(`div`,p,[t(`div`,m,[r(l(u),{modelValue:y.value,"onUpdate:modelValue":o[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),t(`button`,h,c(S.value?`Processing...`:`Send`),1)]),t(`div`,g,[t(`div`,_,[o[1]||=t(`h3`,{"font-semibold":``},` Emotion Message `,-1),(a(!0),n(e,null,s(b.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e),1)]))),128))]),t(`div`,v,[o[2]||=t(`h3`,{"font-semibold":``},` Delays `,-1),(a(!0),n(e,null,s(x.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e)+`s`,1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file +import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,ref as o,renderList as s,toDisplayString as c,unref as l}from"./index-DKziOBM4.js";import"./src-CmPNYgc5.js";import"./Basic-C8g-kAol.js";import{Textarea_default as u}from"./Textarea-BIh0Stpi.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import{llmInferenceEndToken as d,useDelayMessageQueue as f}from"./queues-BZSFjE0u.js";const p={flex:``,"flex-col":``,"gap-2":``,"p-2":``},m={flex:``,"flex-row":``,"gap-2":``},h={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},g={"w-full":``,flex:``,"flex-row":``,"gap-4":``},_={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=i({__name:`delays`,setup(i){let y=o(``),b=o([]),x=o([]),S=o(!1),C=f();C.onHandlerEvent(`delay`,e=>{x.value.push(e)});function w(){S.value=!0;let e=y.value.split(``);for(let t of e)C.add(t);C.add(d),y.value=``,S.value=!1}return(i,o)=>(a(),n(`div`,p,[t(`div`,m,[r(l(u),{modelValue:y.value,"onUpdate:modelValue":o[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),t(`button`,h,c(S.value?`Processing...`:`Send`),1)]),t(`div`,g,[t(`div`,_,[o[1]||=t(`h3`,{"font-semibold":``},` Emotion Message `,-1),(a(!0),n(e,null,s(b.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e),1)]))),128))]),t(`div`,v,[o[2]||=t(`h3`,{"font-semibold":``},` Delays `,-1),(a(!0),n(e,null,s(x.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e)+`s`,1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/developer-Dt-sXJ7n.js b/assets/developer-BDrLqOcT.js similarity index 78% rename from assets/developer-Dt-sXJ7n.js rename to assets/developer-BDrLqOcT.js index 23fe8afd6020a47b2407ea92fa4ffd96d1f9932f..875c3b53eb5b8bb92e206ae5c5576d53fde995e0 100644 --- a/assets/developer-Dt-sXJ7n.js +++ b/assets/developer-BDrLqOcT.js @@ -1 +1 @@ -import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,resolveDirective as o,unref as s,useSettings as c,withDirectives as l}from"./index-BSwg6FIo.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as u}from"./route-block-CC3cgg4Q.js";import{CheckBar_default as d}from"./CheckBar-eDXKHwAa.js";const f={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var p=i({__name:`developer`,setup(i){let u=c();return(i,c)=>{let p=o(`motion`);return a(),n(e,null,[l(r(d,{modelValue:s(u).disableTransitions,"onUpdate:modelValue":c[0]||=e=>s(u).disableTransitions=e,"mb-2":``,"icon-on":`i-solar:people-nearby-bold-duotone`,"icon-off":`i-solar:running-2-line-duotone`,text:`settings.animations.stage-transitions.title`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:440,delay:19*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[p]]),l(r(d,{modelValue:s(u).usePageSpecificTransitions,"onUpdate:modelValue":c[1]||=e=>s(u).usePageSpecificTransitions=e,disabled:s(u).disableTransitions,"icon-on":`i-solar:running-2-line-duotone`,"icon-off":`i-solar:people-nearby-bold-duotone`,text:`settings.animations.use-page-specific-transitions.title`,description:`settings.animations.use-page-specific-transitions.description`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:450,delay:20*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[p]]),l((a(),n(`div`,f,c[2]||=[t(`div`,{text:`60`,"i-solar:code-bold-duotone":``},null,-1)])),[[p]])],64)}}});typeof u==`function`&&u(p);var m=p;export{m as default}; \ No newline at end of file +import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,resolveDirective as o,unref as s,useSettings as c,withDirectives as l}from"./index-DKziOBM4.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as u}from"./route-block-CC3cgg4Q.js";import{CheckBar_default as d}from"./CheckBar-CLfRTriv.js";const f={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var p=i({__name:`developer`,setup(i){let u=c();return(i,c)=>{let p=o(`motion`);return a(),n(e,null,[l(r(d,{modelValue:s(u).disableTransitions,"onUpdate:modelValue":c[0]||=e=>s(u).disableTransitions=e,"mb-2":``,"icon-on":`i-solar:people-nearby-bold-duotone`,"icon-off":`i-solar:running-2-line-duotone`,text:`settings.animations.stage-transitions.title`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:440,delay:19*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[p]]),l(r(d,{modelValue:s(u).usePageSpecificTransitions,"onUpdate:modelValue":c[1]||=e=>s(u).usePageSpecificTransitions=e,disabled:s(u).disableTransitions,"icon-on":`i-solar:running-2-line-duotone`,"icon-off":`i-solar:people-nearby-bold-duotone`,text:`settings.animations.use-page-specific-transitions.title`,description:`settings.animations.use-page-specific-transitions.description`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:450,delay:20*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[p]]),l((a(),n(`div`,f,c[2]||=[t(`div`,{text:`60`,"i-solar:code-bold-duotone":``},null,-1)])),[[p]])],64)}}});typeof u==`function`&&u(p);var m=p;export{m as default}; \ No newline at end of file diff --git a/assets/dist-BziUufTI.js b/assets/dist-B_AZqzk2.js similarity index 99% rename from assets/dist-BziUufTI.js rename to assets/dist-B_AZqzk2.js index c31022091db0238840cc9172ea50d54d3087f063..2330d5b9bc18fe5ce76d921a92c18c5d7ac46e6c 100644 --- a/assets/dist-BziUufTI.js +++ b/assets/dist-B_AZqzk2.js @@ -1,4 +1,4 @@ -import{Comment as e,Fragment as t,Teleport as n,camelize as r,cloneVNode as i,computed as a,createBaseVNode as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createTextVNode as u,createVNode as d,customRef as f,defineComponent as p,effectScope as m,getCurrentInstance as h,getCurrentScope as g,guardReactiveProps as _,h as v,inject as y,isRef as b,markRaw as x,mergeDefaults as S,mergeProps as C,nextTick as w,normalizeProps as T,normalizeStyle as E,onBeforeMount as D,onBeforeUnmount as O,onBeforeUpdate as k,onMounted as A,onScopeDispose as j,onUnmounted as M,onUpdated as N,openBlock as P,provide as F,reactive as I,readonly as ee,ref as L,renderList as te,renderSlot as R,resolveDynamicComponent as ne,shallowReadonly as re,shallowRef as ie,toDisplayString as ae,toHandlerKey as oe,toHandlers as se,toRaw as ce,toRef as le,toRefs as z,triggerRef as ue,unref as B,useId as de,useSlots as fe,vModelSelect as pe,vShow as me,watch as V,watchEffect as H,watchPostEffect as he,watchSyncEffect as ge,withCtx as U,withDirectives as _e,withKeys as W,withModifiers as G}from"./index-BSwg6FIo.js";import{arrow as ve,computePosition as ye,createCoords as be,flip as xe,floor as Se,hide as Ce,limitShift as we,max as Te,min as Ee,offset as De,rectToClientRect as Oe,round as ke,shift as Ae,size as je}from"./src-CX9nVT7I.js";function Me(){return typeof window<`u`}function Ne(e){return Ie(e)?(e.nodeName||``).toLowerCase():`#document`}function Pe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fe(e){var t;return(t=(Ie(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ie(e){return Me()?e instanceof Node||e instanceof Pe(e).Node:!1}function Le(e){return Me()?e instanceof Element||e instanceof Pe(e).Element:!1}function Re(e){return Me()?e instanceof HTMLElement||e instanceof Pe(e).HTMLElement:!1}function ze(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Pe(e).ShadowRoot}function Be(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function Ve(e){return[`table`,`td`,`th`].includes(Ne(e))}function He(e){return[`:popover-open`,`:modal`].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ue(e){let t=Ge(),n=Le(e)?qe(e):e;return[`transform`,`translate`,`scale`,`rotate`,`perspective`].some(e=>n[e]?n[e]!==`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(e=>(n.willChange||``).includes(e))||[`paint`,`layout`,`strict`,`content`].some(e=>(n.contain||``).includes(e))}function We(e){let t=Ye(e);for(;Re(t)&&!Ke(t);){if(Ue(t))return t;if(He(t))return null;t=Ye(t)}return null}function Ge(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}function Ke(e){return[`html`,`body`,`#document`].includes(Ne(e))}function qe(e){return Pe(e).getComputedStyle(e)}function Je(e){return Le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ye(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ze(e)&&e.host||Fe(e);return ze(t)?t.host:t}function Xe(e){let t=Ye(e);return Ke(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&Be(t)?t:Xe(t)}function Ze(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let i=Xe(e),a=i===(r=e.ownerDocument)?.body,o=Pe(i);if(a){let e=Qe(o);return t.concat(o,o.visualViewport||[],Be(i)?i:[],e&&n?Ze(e):[])}return t.concat(i,Ze(i,[],n))}function Qe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $e(e){let t=qe(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Re(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ke(n)!==a||ke(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function et(e){return Le(e)?e:e.contextElement}function tt(e){let t=et(e);if(!Re(t))return be(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$e(t),o=(a?ke(n.width):n.width)/r,s=(a?ke(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const nt=be(0);function rt(e){let t=Pe(e);return!Ge()||!t.visualViewport?nt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function it(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pe(e)?!1:t}function at(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=et(e),o=be(1);t&&(r?Le(r)&&(o=tt(r)):o=tt(e));let s=it(a,n,r)?rt(a):be(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Pe(a),t=r&&Le(r)?Pe(r):r,n=e,i=Qe(n);for(;i&&r&&t!==n;){let e=tt(i),t=i.getBoundingClientRect(),r=qe(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Pe(i),i=Qe(n)}}return Oe({width:u,height:d,x:c,y:l})}function ot(e,t){let n=Je(e).scrollLeft;return t?t.left+n:at(Fe(e)).left+n}function st(e,t,n){n===void 0&&(n=!1);let r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:ot(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function ct(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Fe(r),s=t?He(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=be(1),u=be(0),d=Re(r);if((d||!d&&!a)&&((Ne(r)!==`body`||Be(o))&&(c=Je(r)),Re(r))){let e=at(r);l=tt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?st(o,c,!0):be(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function lt(e){return Array.from(e.getClientRects())}function ut(e){let t=Fe(e),n=Je(e),r=e.ownerDocument.body,i=Te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ot(e),s=-n.scrollTop;return qe(r).direction===`rtl`&&(o+=Te(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function dt(e,t){let n=Pe(e),r=Fe(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ge();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}function ft(e,t){let n=at(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Re(e)?tt(e):be(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,c=i*a.x,l=r*a.y;return{width:o,height:s,x:c,y:l}}function pt(e,t,n){let r;if(t===`viewport`)r=dt(e,n);else if(t===`document`)r=ut(Fe(e));else if(Le(t))r=ft(t,n);else{let n=rt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Oe(r)}function mt(e,t){let n=Ye(e);return n===t||!Le(n)||Ke(n)?!1:qe(n).position===`fixed`||mt(n,t)}function ht(e,t){let n=t.get(e);if(n)return n;let r=Ze(e,[],!1).filter(e=>Le(e)&&Ne(e)!==`body`),i=null,a=qe(e).position===`fixed`,o=a?Ye(e):e;for(;Le(o)&&!Ke(o);){let t=qe(o),n=Ue(o);!n&&t.position===`fixed`&&(i=null);let s=a?!n&&!i:!n&&t.position===`static`&&!!i&&[`absolute`,`fixed`].includes(i.position)||Be(o)&&!n&&mt(e,o);s?r=r.filter(e=>e!==o):i=t,o=Ye(o)}return t.set(e,r),r}function gt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=n===`clippingAncestors`?He(t)?[]:ht(t,this._c):[].concat(n),o=[...a,r],s=o[0],c=o.reduce((e,n)=>{let r=pt(t,n,i);return e.top=Te(r.top,e.top),e.right=Ee(r.right,e.right),e.bottom=Ee(r.bottom,e.bottom),e.left=Te(r.left,e.left),e},pt(t,s,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _t(e){let{width:t,height:n}=$e(e);return{width:t,height:n}}function vt(e,t,n){let r=Re(t),i=Fe(t),a=n===`fixed`,o=at(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=be(0);if(r||!r&&!a)if((Ne(t)!==`body`||Be(i))&&(s=Je(t)),r){let e=at(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&(c.x=ot(i));let l=i&&!r&&!a?st(i,s):be(0),u=o.left+s.scrollLeft-c.x-l.x,d=o.top+s.scrollTop-c.y-l.y;return{x:u,y:d,width:o.width,height:o.height}}function yt(e){return qe(e).position===`static`}function bt(e,t){if(!Re(e)||qe(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Fe(e)===n&&(n=n.ownerDocument.body),n}function xt(e,t){let n=Pe(e);if(He(e))return n;if(!Re(e)){let t=Ye(e);for(;t&&!Ke(t);){if(Le(t)&&!yt(t))return t;t=Ye(t)}return n}let r=bt(e,t);for(;r&&Ve(r)&&yt(r);)r=bt(r,t);return r&&Ke(r)&&yt(r)&&!Ue(r)?n:r||We(e)||n}const St=async function(e){let t=this.getOffsetParent||xt,n=this.getDimensions,r=await n(e.floating);return{reference:vt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ct(e){return qe(e).direction===`rtl`}const wt={convertOffsetParentRelativeRectToViewportRelativeRect:ct,getDocumentElement:Fe,getClippingRect:gt,getOffsetParent:xt,getElementRects:St,getClientRects:lt,getDimensions:_t,getScale:tt,isElement:Le,isRTL:Ct};function Tt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Et(e,t){let n=null,r,i=Fe(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Se(d),h=Se(i.clientWidth-(u+f)),g=Se(i.clientHeight-(d+p)),_=Se(u),v=-m+`px `+-h+`px `+-g+`px `+-_+`px`,y={rootMargin:v,threshold:Te(0,Ee(1,c))||1},b=!0;function x(t){let n=t[0].intersectionRatio;if(n!==c){if(!b)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Tt(l,e.getBoundingClientRect())&&o(),b=!1}try{n=new IntersectionObserver(x,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,y)}n.observe(e)}return o(!0),a}function Dt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=et(e),u=i||a?[...l?Ze(l):[],...Ze(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Et(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?at(e):null;c&&g();function g(){let t=at(e);h&&!Tt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const Ot=De,kt=Ae,At=xe,jt=je,Mt=Ce,Nt=ve,Pt=we,Ft=(e,t,n)=>{let r=new Map,i={platform:wt,...n},a={...i.platform,_c:r};return ye(e,t,{...i,platform:a})};function It(e){return typeof e==`object`&&!!e&&`$el`in e}function Lt(e){if(It(e)){let t=e.$el;return Ie(t)&&Ne(t)===`#comment`?null:t}return e}function Rt(e){return typeof e==`function`?e():B(e)}function zt(e){return{name:`arrow`,options:e,fn(t){let n=Lt(Rt(e.element));return n==null?{}:Nt({element:n,padding:e.padding}).fn(t)}}}function Bt(e){if(typeof window>`u`)return 1;let t=e.ownerDocument.defaultView||window;return t.devicePixelRatio||1}function Vt(e,t){let n=Bt(e);return Math.round(t*n)/n}function Ht(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=a(()=>{var e;return(e=Rt(n.open))??!0}),o=a(()=>Rt(n.middleware)),s=a(()=>{var e;return(e=Rt(n.placement))??`bottom`}),c=a(()=>{var e;return(e=Rt(n.strategy))??`absolute`}),l=a(()=>{var e;return(e=Rt(n.transform))??!0}),u=a(()=>Lt(e.value)),d=a(()=>Lt(t.value)),f=L(0),p=L(0),m=L(c.value),h=L(s.value),_=ie({}),v=L(!1),y=a(()=>{let e={position:m.value,left:`0`,top:`0`};if(!d.value)return e;let t=Vt(d.value,f.value),n=Vt(d.value,p.value);return l.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...Bt(d.value)>=1.5&&{willChange:`transform`}}:{position:m.value,left:t+`px`,top:n+`px`}}),b;function x(){if(u.value==null||d.value==null)return;let e=i.value;Ft(u.value,d.value,{middleware:o.value,placement:s.value,strategy:c.value}).then(t=>{f.value=t.x,p.value=t.y,m.value=t.strategy,h.value=t.placement,_.value=t.middlewareData,v.value=e!==!1})}function S(){typeof b==`function`&&(b(),b=void 0)}function C(){if(S(),r===void 0){x();return}if(u.value!=null&&d.value!=null){b=r(u.value,d.value,x);return}}function w(){i.value||(v.value=!1)}return V([o,s,c,i],x,{flush:`sync`}),V([u,d],C,{flush:`sync`}),V(i,w,{flush:`sync`}),g()&&j(S),{x:re(f),y:re(p),strategy:re(m),placement:re(h),middlewareData:re(_),isPositioned:re(v),floatingStyles:y,update:x}}function Ut(e,t){return e-t*Math.floor(e/t)}const Wt=1721426;function Gt(e,t,n,r){t=qt(e,t);let i=t-1,a=-2;return n<=2?a=0:Kt(t)&&(a=-1),Wt-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function Kt(e){return e%4==0&&(e%100!=0||e%400==0)}function qt(e,t){return e===`BC`?1-t:t}function Jt(e){let t=`AD`;return e<=0&&(t=`BC`,e=1-e),[t,e]}const Yt={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};var Xt=class{fromJulianDay(e){let t=e,n=t-Wt,r=Math.floor(n/146097),i=Ut(n,146097),a=Math.floor(i/36524),o=Ut(i,36524),s=Math.floor(o/1461),c=Ut(o,1461),l=Math.floor(c/365),u=r*400+a*100+s*4+l+(a!==4&&l!==4?1:0),[d,f]=Jt(u),p=t-Gt(d,f,1,1),m=2;t0&&t===pn())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=Cn(e,t),c=bn(n,r,i,a,o,s,0);return c-Math.floor(e/1e3)*1e3}const Sn=new Map;function Cn(e,t){let n=Sn.get(t);n||(n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),Sn.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let e of r)e.type!==`literal`&&(i[e.type]=e.value);return{year:i.era===`BC`||i.era===`B`?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour===`24`?0:+i.hour,minute:+i.minute,second:+i.second}}const wn=864e5;function Tn(e,t,n,r){let i=n===r?[n]:[n,r];return i.filter(n=>En(e,t,n))}function En(e,t,n){let r=Cn(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function Dn(e,t,n=`compatible`){let r=jn(e);if(t===`UTC`)return yn(r);if(t===pn()&&n===`compatible`){r=Mn(r,new Xt);let e=new Date,t=qt(r.era,r.year);return e.setFullYear(t,r.month-1,r.day),e.setHours(r.hour,r.minute,r.second,r.millisecond),e.getTime()}let i=yn(r),a=xn(i-wn,t),o=xn(i+wn,t),s=Tn(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case`compatible`:case`earlier`:return s[0];case`later`:return s[s.length-1];case`reject`:throw RangeError(`Multiple possible absolute times found`)}switch(n){case`earlier`:return Math.min(i-a,i-o);case`compatible`:case`later`:return Math.max(i-a,i-o);case`reject`:throw RangeError(`No such absolute time found`)}}function On(e,t,n=`compatible`){return new Date(Dn(e,t,n))}function kn(e,t){let n=xn(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new yr(i<1?`BC`:`AD`,i<1?-i+1:i,a,o,t,n,s,c,l,u)}function An(e){return new hr(e.calendar,e.era,e.year,e.month,e.day)}function jn(e,t){let n=0,r=0,i=0,a=0;if(`timeZone`in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if(`hour`in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new _r(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function Mn(e,t){if(nn(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Hn(r),r}function Nn(e,t,n){if(e instanceof yr)return e.timeZone===t?e:Fn(e,t);let r=Dn(e,t,n);return kn(r,t)}function Pn(e){let t=yn(e)-e.offset;return new Date(t)}function Fn(e,t){let n=yn(e)-e.offset;return Mn(kn(n,t),e.calendar)}const In=36e5;function Ln(e,t){let n=e.copy(),r=`hour`in n?Xn(n,t):0;Rn(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,zn(n),Vn(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,Bn(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var a,o;let e=(a=(o=n.calendar).isInverseEra)?.call(o,n);n.year=i,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Rn(e,t){var n,r;(n=(r=e.calendar).isInverseEra)?.call(r,e)&&(t=-t),e.year+=t}function zn(e){for(;e.month<1;)Rn(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Rn(e,1)}function Bn(e){for(;e.day<1;)e.month--,zn(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,zn(e)}function Vn(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Hn(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Vn(e)}function Un(e){let t={};for(let n in e)typeof e[n]==`number`&&(t[n]=-e[n]);return t}function Wn(e,t){return Ln(e,Un(t))}function Gn(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Hn(n),n}function Kn(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),Jn(n),n}function qn(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Yn(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Yn(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Yn(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Yn(e.hour,24),t}function Jn(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Yn(e,t){let n=e%t;return n<0&&(n+=t),n}function Xn(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,qn(e)}function Zn(e,t,n,r){let i=e.copy();switch(t){case`era`:{let t=e.calendar.getEras(),a=t.indexOf(e.era);if(a<0)throw Error(`Invalid era: `+e.era);a=$n(a,n,0,t.length-1,r?.round),i.era=t[a],Hn(i);break}case`year`:var a,o;(a=(o=i.calendar).isInverseEra)?.call(o,i)&&(n=-n),i.year=$n(e.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case`month`:i.month=$n(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case`day`:i.day=$n(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error(`Unsupported field `+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),Hn(i),i}function Qn(e,t,n,r){let i=e.copy();switch(t){case`hour`:{let t=e.hour,a=0,o=23;if(r?.hourCycle===12){let e=t>=12;a=e?12:0,o=e?23:11}i.hour=$n(t,n,a,o,r?.round);break}case`minute`:i.minute=$n(e.minute,n,0,59,r?.round);break;case`second`:i.second=$n(e.second,n,0,59,r?.round);break;case`millisecond`:i.millisecond=$n(e.millisecond,n,0,999,r?.round);break;default:throw Error(`Unsupported field `+t)}return i}function $n(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,er&&(e=n+(e-r-1));return e}function er(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let r=Ln(jn(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Dn(r,e.timeZone)}else n=yn(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=kn(n,e.timeZone);return Mn(r,e.calendar)}function tr(e,t){return er(e,Un(t))}function nr(e,t,n,r){switch(t){case`hour`:{let t=0,i=23;if(r?.hourCycle===12){let n=e.hour>=12;t=n?12:0,i=n?23:11}let a=jn(e),o=Mn(Kn(a,{hour:t}),new Xt),s=[Dn(o,e.timeZone,`earlier`),Dn(o,e.timeZone,`later`)].filter(t=>kn(t,e.timeZone).day===o.day)[0],c=Mn(Kn(a,{hour:i}),new Xt),l=[Dn(c,e.timeZone,`earlier`),Dn(c,e.timeZone,`later`)].filter(t=>kn(t,e.timeZone).day===c.day).pop(),u=yn(e)-e.offset,d=Math.floor(u/In),f=u%In;return u=$n(d,n,Math.floor(s/In),Math.floor(l/In),r?.round)*In+f,Mn(kn(u,e.timeZone),e.calendar)}case`minute`:case`second`:case`millisecond`:return Qn(e,t,n,r);case`era`:case`year`:case`month`:case`day`:{let i=Zn(jn(e),t,n,r),a=Dn(i,e.timeZone);return Mn(kn(a,e.timeZone),e.calendar)}default:throw Error(`Unsupported field `+t)}}function rr(e,t,n){let r=jn(e),i=Kn(Gn(r,t),t);if(i.compare(r)===0)return e;let a=Dn(i,e.timeZone,n);return Mn(kn(a,e.timeZone),e.calendar)}const ir=[`hours`,`minutes`,`seconds`],ar=[`years`,`months`,`weeks`,`days`,...ir];function or(e){return`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}:${String(e.second).padStart(2,`0`)}${e.millisecond?String(e.millisecond/1e3).slice(1):``}`}function sr(e){let t=Mn(e,new Xt),n;return n=t.era===`BC`?t.year===1?`0000`:`-`+String(Math.abs(1-t.year)).padStart(6,`00`):String(t.year).padStart(4,`0`),`${n}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function cr(e){return`${sr(e)}T${or(e)}`}function lr(e){let t=Math.sign(e)<0?`-`:`+`;e=Math.abs(e);let n=Math.floor(e/36e5),r=e%36e5/6e4;return`${t}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`}function ur(e){return`${cr(e)}${lr(e.offset)}[${e.timeZone}]`}function dr(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function fr(e,t,n){dr(e,t),t.set(e,n)}function pr(e){let t=typeof e[0]==`object`?e.shift():new Xt,n;if(typeof e[0]==`string`)n=e.shift();else{let e=t.getEras();n=e[e.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var mr=new WeakMap,hr=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(e){return Ln(this,e)}subtract(e){return Wn(this,e)}set(e){return Gn(this,e)}cycle(e,t,n){return Zn(this,e,t,n)}toDate(e){return On(this,e)}toString(){return sr(this)}compare(e){return ln(this,e)}constructor(...e){fr(this,mr,{writable:!0,value:void 0});let[t,n,r,i,a]=pr(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,Hn(this)}},gr=new WeakMap,_r=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return Ln(this,e)}subtract(e){return Wn(this,e)}set(e){return Gn(Kn(this,e),e)}cycle(e,t,n){switch(e){case`era`:case`year`:case`month`:case`day`:return Zn(this,e,t,n);default:return Qn(this,e,t,n)}}toDate(e,t){return On(this,e,t)}toString(){return cr(this)}compare(e){let t=ln(this,e);return t===0?un(this,jn(e)):t}constructor(...e){fr(this,gr,{writable:!0,value:void 0});let[t,n,r,i,a]=pr(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Hn(this)}},vr=new WeakMap,yr=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return er(this,e)}subtract(e){return tr(this,e)}set(e,t){return rr(this,e,t)}cycle(e,t,n){return nr(this,e,t,n)}toDate(){return Pn(this)}toString(){return ur(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-Nn(e,this.timeZone).toDate().getTime()}constructor(...e){fr(this,vr,{writable:!0,value:void 0});let[t,n,r,i,a]=pr(e),o=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.timeZone=o,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Hn(this)}};const br=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],xr=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],Sr=[1867,1911,1925,1988,2018],Cr=[`meiji`,`taisho`,`showa`,`heisei`,`reiwa`];function wr(e){let t=br.findIndex(([t,n,r])=>e.year=0){let[,n,r]=br[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return Cr}getYearsInEra(e){let t=Cr.indexOf(e.era),n=br[t],r=br[t+1];if(r==null)return 9999-n[0]+1;let i=r[0]-n[0];return(e.month0?[`minguo`,t]:[`before_minguo`,1-t]}var Pr=class extends Xt{fromJulianDay(e){let t=super.fromJulianDay(e),n=qt(t.era,t.year),[r,i]=Nr(n);return new hr(this,r,i,t.month,t.day)}toJulianDay(e){return super.toJulianDay(Fr(e))}getEras(){return[`before_minguo`,`minguo`]}balanceDate(e){let[t,n]=Nr(Mr(e));e.era=t,e.year=n}isInverseEra(e){return e.era===`before_minguo`}getDaysInMonth(e){return super.getDaysInMonth(Fr(e))}getYearsInEra(e){return e.era===`before_minguo`?9999:9999-jr}constructor(...e){super(...e),this.identifier=`roc`}};function Fr(e){let[t,n]=Jt(Mr(e));return new hr(t,n,e.month,e.day)}const Ir=1948320,Lr=[0,31,62,93,124,155,186,216,246,276,306,336];var Rr=class{fromJulianDay(e){let t=e-Ir,n=1+Math.floor((33*t+3)/12053),r=365*(n-1)+Math.floor((8*n+21)/33),i=t-r,a=i<216?Math.floor(i/31):Math.floor((i-6)/30),o=i-Lr[a]+1;return new hr(this,n,a+1,o)}toJulianDay(e){let t=Ir-1+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=Lr[e.month-1],t+=e.day,t}getMonthsInYear(){return 12}getDaysInMonth(e){if(e.month<=6)return 31;if(e.month<=11)return 30;let t=Ut(25*e.year+11,33)<8;return t?30:29}getEras(){return[`AP`]}getYearsInEra(){return 9377}constructor(){this.identifier=`persian`}};const zr=78,Br=80;var Vr=class extends Xt{fromJulianDay(e){let t=super.fromJulianDay(e),n=t.year-zr,r=e-Gt(t.era,t.year,1,1),i;r=8&&(a+=(e.month-7)*30),a+=e.day-1,a)}getDaysInMonth(e){return e.month===1&&Kt(e.year+zr)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return[`saka`]}balanceDate(){}constructor(...e){super(...e),this.identifier=`indian`}};const Hr=1948440,Ur=1948439,Wr=1300,Gr=1600,Kr=460322;function qr(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function Jr(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),i=Math.min(12,Math.ceil((n-(29+qr(t,r,1,1)))/29.5)+1),a=n-qr(t,r,i,1)+1;return new hr(e,r,i,a)}function Yr(e){return(14+11*e)%30<11}var Xr=class{fromJulianDay(e){return Jr(this,Hr,e)}toJulianDay(e){return qr(Hr,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return e.month===12&&Yr(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return Yr(e.year)?355:354}getYearsInEra(){return 9665}getEras(){return[`AH`]}constructor(){this.identifier=`islamic-civil`}},Zr=class extends Xr{fromJulianDay(e){return Jr(this,Ur,e)}toJulianDay(e){return qr(Ur,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier=`islamic-tbla`}};const Qr=`qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=`;let $r,ei;function ti(e){return Kr+ei[e-Wr]}function ni(e,t){let n=e-Wr,r=1<<11-(t-1);return($r[n]&r)===0?29:30}function ri(e,t){let n=ti(e);for(let r=1;rr)return super.fromJulianDay(e);{let e=Wr-1,n=1,r=1;for(;r>0;){e++,r=t-ti(e)+1;let i=ii(e);if(r===i){n=12;break}else if(rt;)r-=t,n++,t=ni(e,n);break}}return new hr(this,e,n,t-ri(e,n)+1)}}toJulianDay(e){return e.yearGr?super.toJulianDay(e):Hr+ri(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.yearGr?super.getDaysInMonth(e):ni(e.year,e.month)}getDaysInYear(e){return e.yearGr?super.getDaysInYear(e):ii(e.year)}constructor(){if(super(),this.identifier=`islamic-umalqura`,$r||=new Uint16Array(Uint8Array.from(atob(Qr),e=>e.charCodeAt(0)).buffer),!ei){ei=new Uint32Array(Gr-Wr+1);let e=0;for(let t=Wr;t<=Gr;t++){ei[t-Wr]=e;for(let n=1;n<=12;n++)e+=ni(t,n)}}}};const oi=347997,si=1080,ci=24*si,li=29,ui=12*si+793,di=li*ci+ui;function fi(e){return Ut(e*7+1,19)<7}function pi(e){let t=Math.floor((235*e-234)/19),n=12084+13753*t,r=t*29+Math.floor(n/25920);return Ut(3*(r+1),7)<3&&(r+=1),r}function mi(e){let t=pi(e-1),n=pi(e),r=pi(e+1);return r-n===356?2:n-t===382?1:0}function hi(e){return pi(e)+mi(e)}function gi(e){return hi(e+1)-hi(e)}function _i(e){let t=gi(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function vi(e,t){if(t>=6&&!fi(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=_i(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?fi(e)?30:0:30}var yi=class{fromJulianDay(e){let t=e-oi,n=t*ci/di,r=Math.floor((19*n+234)/235)+1,i=hi(r),a=Math.floor(t-i);for(;a<1;)r--,i=hi(r),a=Math.floor(t-i);let o=1,s=0;for(;s6?e.month--:!fi(t.year)&&fi(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier=`hebrew`}};const bi=1723856,xi=1824665,Si=5500;function Ci(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function wi(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-Ci(e,n,1,1))/30),i=t+1-Ci(e,n,r,1);return[n,r,i]}function Ti(e){return Math.floor(e%4/3)}function Ei(e,t){return t%13==0?Ti(e)+5:30}var Di=class{fromJulianDay(e){let[t,n,r]=wi(bi,e),i=`AM`;return t<=0&&(i=`AA`,t+=Si),new hr(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`AA`&&(t-=Si),Ci(bi,t,e.month,e.day)}getDaysInMonth(e){return Ei(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+Ti(e.year)}getYearsInEra(e){return e.era===`AA`?9999:9991}getEras(){return[`AA`,`AM`]}constructor(){this.identifier=`ethiopic`}},Oi=class extends Di{fromJulianDay(e){let[t,n,r]=wi(bi,e);return t+=Si,new hr(this,`AA`,t,n,r)}getEras(){return[`AA`]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier=`ethioaa`}},ki=class extends Di{fromJulianDay(e){let[t,n,r]=wi(xi,e),i=`CE`;return t<=0&&(i=`BCE`,t=1-t),new hr(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`BCE`&&(t=1-t),Ci(xi,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return e.era===`BCE`&&(t=1-t),Ei(t,e.month)}isInverseEra(e){return e.era===`BCE`}balanceDate(e){e.year<=0&&(e.era=e.era===`BCE`?`CE`:`BCE`,e.year=1-e.year)}getEras(){return[`BCE`,`CE`]}getYearsInEra(e){return e.era===`BCE`?9999:9715}constructor(...e){super(...e),this.identifier=`coptic`}};function Ai(e){switch(e){case`buddhist`:return new kr;case`ethiopic`:return new Di;case`ethioaa`:return new Oi;case`coptic`:return new ki;case`hebrew`:return new yi;case`indian`:return new Vr;case`islamic-civil`:return new Xr;case`islamic-tbla`:return new Zr;case`islamic-umalqura`:return new ai;case`japanese`:return new Er;case`persian`:return new Rr;case`roc`:return new Pr;case`gregory`:default:return new Xt}}let ji=new Map;var Mi=class{format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange==`function`)return this.formatter.formatRange(e,t);if(t= start date`);return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts==`function`)return this.formatter.formatRangeToParts(e,t);if(t= start date`);let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return Ri()&&(this.resolvedHourCycle||=zi(e.locale,this.options),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle===`h11`||this.resolvedHourCycle===`h12`),e.calendar===`ethiopic-amete-alem`&&(e.calendar=`ethioaa`),e}constructor(e,t={}){this.formatter=Pi(e,t),this.options=t}};const Ni={true:{ja:`h11`},false:{}};function Pi(e,t={}){if(typeof t.hour12==`boolean`&&Ii()){t={...t};let n=Ni[String(t.hour12)][e.split(`-`)[0]],r=t.hour12?`h12`:`h23`;t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]e.type===`hour`).value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>e.type===`hour`).value,10);if(r===0&&i===23)return`h23`;if(r===24&&i===23)return`h24`;if(r===0&&i===11)return`h11`;if(r===12&&i===11)return`h12`;throw Error(`Unexpected hour cycle result`)}let Bi=new Map,Vi=!1;try{Vi=new Intl.NumberFormat(`de-DE`,{signDisplay:`exceptZero`}).resolvedOptions().signDisplay===`exceptZero`}catch{}let Hi=!1;try{Hi=new Intl.NumberFormat(`de-DE`,{style:`unit`,unit:`degree`}).resolvedOptions().style===`unit`}catch{}const Ui={degree:{narrow:{default:`°`,"ja-JP":` 度`,"zh-TW":`度`,"sl-SI":` °`}}};var Wi=class{format(e){let t=``;if(t=!Vi&&this.options.signDisplay!=null?Ki(this.numberFormatter,this.options.signDisplay,e):this.numberFormatter.format(e),this.options.style===`unit`&&!Hi){var n;let{unit:e,unitDisplay:r=`short`,locale:i}=this.resolvedOptions();if(!e)return t;let a=(n=Ui[e])?.[r];t+=a[i]||a.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange==`function`)return this.numberFormatter.formatRange(e,t);if(t= start date`);return`${this.format(e)} \u{2013} ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts==`function`)return this.numberFormatter.formatRangeToParts(e,t);if(t= start date`);let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!Vi&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!Hi&&this.options.style===`unit`&&(e={...e,style:`unit`,unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=Gi(e,t),this.options=t}};function Gi(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes(`-nu-`)&&(e.includes(`-u-`)||(e+=`-u-`),e+=`-nu-${n}`),t.style===`unit`&&!Hi){var r;let{unit:e,unitDisplay:n=`short`}=t;if(!e)throw Error(`unit option must be provided with style: "unit"`);if(!(r=Ui[e])?.[n])throw Error(`Unsupported unit ${e} with unitDisplay = ${n}`);t={...t,style:`decimal`}}let i=e+(t?Object.entries(t).sort((e,t)=>e[0]0||Object.is(n,0):t===`exceptZero`&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,``).replace(/\u200e|\u061C/,``);[...i].length!==1&&console.warn(`@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case`);let a=t.replace(r,`!!!`).replace(i,`+`).replace(`!!!`,r);return a}else return e.format(n)}}const qi=RegExp(`^.*\\(.*\\).*$`),Ji=[`latn`,`arab`,`hanidec`,`deva`,`beng`];var Yi=class{parse(e){return Zi(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,n){return Zi(this.locale,this.options,e).isValidPartialNumber(e,t,n)}getNumberingSystem(e){return Zi(this.locale,this.options,e).options.numberingSystem}constructor(e,t={}){this.locale=e,this.options=t}};const Xi=new Map;function Zi(e,t,n){let r=Qi(e,t);if(!e.includes(`-nu-`)&&!r.isValidPartialNumber(n)){for(let i of Ji)if(i!==r.options.numberingSystem){let r=Qi(e+(e.includes(`-u-`)?`-nu-`:`-u-nu-`)+i,t);if(r.isValidPartialNumber(n))return r}}return r}function Qi(e,t){let n=e+(t?Object.entries(t).sort((e,t)=>e[0]-1&&(t=`-${t}`)}let n=t?+t:NaN;if(isNaN(n))return NaN;if(this.options.style===`percent`){var r,i;let e={...this.options,style:`decimal`,minimumFractionDigits:Math.min(((r=this.options.minimumFractionDigits)??0)+2,20),maximumFractionDigits:Math.min(((i=this.options.maximumFractionDigits)??0)+2,20)};return new Yi(this.locale,e).parse(new Wi(this.locale,e).format(n))}return this.options.currencySign===`accounting`&&qi.test(e)&&(n=-1*n),n}sanitize(e){return e=e.replace(this.symbols.literals,``),this.symbols.minusSign&&(e=e.replace(`-`,this.symbols.minusSign)),this.options.numberingSystem===`arab`&&(this.symbols.decimal&&(e=e.replace(`,`,this.symbols.decimal),e=e.replace(`،`,this.symbols.decimal)),this.symbols.group&&(e=ra(e,`.`,this.symbols.group))),this.options.locale===`fr-FR`&&(e=ra(e,`.`,` `)),e}isValidPartialNumber(e,t=-1/0,n=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=ra(e,this.symbols.group,``)),e=e.replace(this.symbols.numeral,``),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,``)),e.length===0)}constructor(e,t={}){this.locale=e,this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=na(e,this.formatter,this.options,t);var n,r;this.options.style===`percent`&&(((n=this.options.minimumFractionDigits)??0)>18||((r=this.options.maximumFractionDigits)??0)>18)&&console.warn(`NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.`)}};const ea=new Set([`decimal`,`fraction`,`integer`,`minusSign`,`plusSign`,`group`]),ta=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function na(e,t,n,r){var i,a,o,s;let c=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:`auto`,roundingMode:`halfExpand`}),l=c.formatToParts(-10000.111),u=c.formatToParts(10000.111),d=ta.map(e=>c.formatToParts(e));var f;let p=(f=(i=l.find(e=>e.type===`minusSign`))?.value)??`-`,m=(a=u.find(e=>e.type===`plusSign`))?.value;!m&&(r?.signDisplay===`exceptZero`||r?.signDisplay===`always`)&&(m=`+`);let h=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001),g=(o=h.find(e=>e.type===`decimal`))?.value,_=(s=l.find(e=>e.type===`group`))?.value,v=l.filter(e=>!ea.has(e.type)).map(e=>ia(e.value)),y=d.flatMap(e=>e.filter(e=>!ea.has(e.type)).map(e=>ia(e.value))),b=[...new Set([...v,...y])].sort((e,t)=>t.length-e.length),x=b.length===0?RegExp(`[\\p{White_Space}]`,`gu`):RegExp(`${b.join(`|`)}|[\\p{White_Space}]`,`gu`),S=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),C=new Map(S.map((e,t)=>[e,t])),w=RegExp(`[${S.join(``)}]`,`g`),T=e=>String(C.get(e));return{minusSign:p,plusSign:m,decimal:g,group:_,literals:x,numeral:w,index:T}}function ra(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function ia(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function aa(e,t){let n=[];for(let r=0;r0}function pa(e,t){return e.compare(t)<=0}function ma(e,t){return e.compare(t)>=0}function ha(e,t,n){return ma(e,t)&&pa(e,n)}function ga(e,t,n){return fa(e,t)&&da(e,n)}function _a(e,t,n){let r=on(e,n);return t>r?e.subtract({days:r+7-t}):t===r?e:e.subtract({days:r-t})}function va(e,t,n){let r=on(e,n),i=t===0?6:t-1;return r===i?e:r>i?e.add({days:7-r+i}):e.add({days:i-r})}function ya(e,t,n,r){if(n===void 0&&r===void 0)return!0;let i=e.add({days:1});if(r!=null&&r(i)||n!=null&&n(i))return!1;let a=t;for(;i.compare(a)<0;)if(i=i.add({days:1}),r!=null&&r(i)||n!=null&&n(i))return!1;return!0}function ba(e,t){let n=[],r=e.add({days:1}),i=t;for(;r.compare(i)<0;)n.push(r),r=r.add({days:1});return n}function xa(e){let{dateObj:t,weekStartsOn:n,fixedWeeks:r,locale:i}=e,a=ua(t),o=Array.from({length:a},(e,n)=>t.set({day:n+1})),s=mn(t),c=hn(t),l=_a(s,n,i),u=va(c,n,i),d=ba(l.subtract({days:1}),s),f=ba(c,u.add({days:1})),p=d.length+o.length+f.length;if(r&&p<42){let e=42-p,n=f[f.length-1];n||=hn(t);let r=Array.from({length:e},(e,t)=>{let r=t+1;return n.add({days:r})});f.push(...r)}let m=d.concat(o,f),h=aa(m,7);return{value:t,cells:m,rows:h}}function Sa(e){let{numberOfMonths:t,dateObj:n,...r}=e,i=[];if(!t||t===1)return i.push(xa({...r,dateObj:n})),i;i.push(xa({...r,dateObj:n}));for(let e=1;e{let n=y(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},e=>(F(r,e),e)]}function Ca(e,t,n){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function wa(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function Ta(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function Ea(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=Ta(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return Number.isNaN(t)?!Number.isNaN(n)&&a>n&&(a=Math.floor(Ta(n/r,r))*r):an&&(a=t+Math.floor(Ta((n-t)/r,r))*r),a=Ta(a,r),a}function Da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Oa=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const ka=Da(Oa);function Aa(e,t){if(e.length!==t.length)return!1;for(let n=0;nka(e,t)),i=e.findIndex(e=>ka(e,n));if(r===-1||i===-1)return[];let[a,o]=[r,i].sort((e,t)=>e-t);return e.slice(a,o+1)}const Ma=typeof document<`u`;function Na(e){return e==null}function Pa(e){let{defaultValue:t,defaultPlaceholder:n,granularity:r=`day`,locale:i=`en`}=e;if(Array.isArray(t)&&t.length)return t.at(-1).copy();if(t&&!Array.isArray(t))return t.copy();if(n)return n.copy();let a=new Date,o=a.getFullYear(),s=a.getMonth()+1,c=a.getDate(),l=[`hour`,`minute`,`second`],u=new Mi(i),d=Ai(u.resolvedOptions().calendar);return l.includes(r??`day`)?Mn(new _r(o,s,c,0,0,0),d):Mn(new hr(o,s,c),d)}const Fa=`ach.af.am.an.ar.ast.az.be.bg.bn.br.bs.ca.cak.ckb.cs.cy.da.de.dsb.el.en.eo.es.et.eu.fa.ff.fi.fr.fy.ga.gd.gl.he.hr.hsb.hu.ia.id.it.ja.ka.kk.kn.ko.lb.lo.lt.lv.meh.ml.ms.nl.nn.no.oc.pl.pt.rm.ro.ru.sc.scn.sk.sl.sr.sv.szl.tg.th.tr.uk.zh-CN.zh-TW`.split(`.`),Ia=[`year`,`month`,`day`],La={ach:{year:`mwaka`,month:`dwe`,day:`nino`},af:{year:`jjjj`,month:`mm`,day:`dd`},am:{year:`ዓዓዓዓ`,month:`ሚሜ`,day:`ቀቀ`},an:{year:`aaaa`,month:`mm`,day:`dd`},ar:{year:`سنة`,month:`شهر`,day:`يوم`},ast:{year:`aaaa`,month:`mm`,day:`dd`},az:{year:`iiii`,month:`aa`,day:`gg`},be:{year:`гггг`,month:`мм`,day:`дд`},bg:{year:`гггг`,month:`мм`,day:`дд`},bn:{year:`yyyy`,month:`মিমি`,day:`dd`},br:{year:`bbbb`,month:`mm`,day:`dd`},bs:{year:`gggg`,month:`mm`,day:`dd`},ca:{year:`aaaa`,month:`mm`,day:`dd`},cak:{year:`jjjj`,month:`ii`,day:`q'q'`},ckb:{year:`ساڵ`,month:`مانگ`,day:`ڕۆژ`},cs:{year:`rrrr`,month:`mm`,day:`dd`},cy:{year:`bbbb`,month:`mm`,day:`dd`},da:{year:`åååå`,month:`mm`,day:`dd`},de:{year:`jjjj`,month:`mm`,day:`tt`},dsb:{year:`llll`,month:`mm`,day:`źź`},el:{year:`εεεε`,month:`μμ`,day:`ηη`},en:{year:`yyyy`,month:`mm`,day:`dd`},eo:{year:`jjjj`,month:`mm`,day:`tt`},es:{year:`aaaa`,month:`mm`,day:`dd`},et:{year:`aaaa`,month:`kk`,day:`pp`},eu:{year:`uuuu`,month:`hh`,day:`ee`},fa:{year:`سال`,month:`ماه`,day:`روز`},ff:{year:`hhhh`,month:`ll`,day:`ññ`},fi:{year:`vvvv`,month:`kk`,day:`pp`},fr:{year:`aaaa`,month:`mm`,day:`jj`},fy:{year:`jjjj`,month:`mm`,day:`dd`},ga:{year:`bbbb`,month:`mm`,day:`ll`},gd:{year:`bbbb`,month:`mm`,day:`ll`},gl:{year:`aaaa`,month:`mm`,day:`dd`},he:{year:`שנה`,month:`חודש`,day:`יום`},hr:{year:`gggg`,month:`mm`,day:`dd`},hsb:{year:`llll`,month:`mm`,day:`dd`},hu:{year:`éééé`,month:`hh`,day:`nn`},ia:{year:`aaaa`,month:`mm`,day:`dd`},id:{year:`tttt`,month:`bb`,day:`hh`},it:{year:`aaaa`,month:`mm`,day:`gg`},ja:{year:` 年 `,month:`月`,day:`日`},ka:{year:`წწწწ`,month:`თთ`,day:`რრ`},kk:{year:`жжжж`,month:`аа`,day:`кк`},kn:{year:`ವವವವ`,month:`ಮಿಮೀ`,day:`ದಿದಿ`},ko:{year:`연도`,month:`월`,day:`일`},lb:{year:`jjjj`,month:`mm`,day:`dd`},lo:{year:`ປປປປ`,month:`ດດ`,day:`ວວ`},lt:{year:`mmmm`,month:`mm`,day:`dd`},lv:{year:`gggg`,month:`mm`,day:`dd`},meh:{year:`aaaa`,month:`mm`,day:`dd`},ml:{year:`വർഷം`,month:`മാസം`,day:`തീയതി`},ms:{year:`tttt`,month:`mm`,day:`hh`},nl:{year:`jjjj`,month:`mm`,day:`dd`},nn:{year:`åååå`,month:`mm`,day:`dd`},no:{year:`åååå`,month:`mm`,day:`dd`},oc:{year:`aaaa`,month:`mm`,day:`jj`},pl:{year:`rrrr`,month:`mm`,day:`dd`},pt:{year:`aaaa`,month:`mm`,day:`dd`},rm:{year:`oooo`,month:`mm`,day:`dd`},ro:{year:`aaaa`,month:`ll`,day:`zz`},ru:{year:`гггг`,month:`мм`,day:`дд`},sc:{year:`aaaa`,month:`mm`,day:`dd`},scn:{year:`aaaa`,month:`mm`,day:`jj`},sk:{year:`rrrr`,month:`mm`,day:`dd`},sl:{year:`llll`,month:`mm`,day:`dd`},sr:{year:`гггг`,month:`мм`,day:`дд`},sv:{year:`åååå`,month:`mm`,day:`dd`},szl:{year:`rrrr`,month:`mm`,day:`dd`},tg:{year:`сссс`,month:`мм`,day:`рр`},th:{year:`ปปปป`,month:`ดด`,day:`วว`},tr:{year:`yyyy`,month:`aa`,day:`gg`},uk:{year:`рррр`,month:`мм`,day:`дд`},"zh-CN":{year:`年`,month:`月`,day:`日`},"zh-TW":{year:`年`,month:`月`,day:`日`}};function Ra(e){if(Ba(e))return La[e];{let t=Wa(e);return Ba(t)?La[t]:La.en}}function za(e,t,n){return Va(e)?Ra(n)[e]:Ua(e)?t:Ha(e)?`––`:``}function Ba(e){return Fa.includes(e)}function Va(e){return Ia.includes(e)}function Ha(e){return e===`hour`||e===`minute`||e===`second`}function Ua(e){return e===`era`||e===`dayPeriod`}function Wa(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}const Ga=[`day`,`month`,`year`],Ka=[`hour`,`minute`,`second`,`dayPeriod`],qa=[...Ga,...Ka];function Ja(e){return Ga.includes(e)}function Ya(e){return qa.includes(e)}function Xa(e,t){let n={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`short`,hourCycle:t===24?`h24`:void 0,hour12:t===24?!1:void 0};return e===`day`&&(delete n.second,delete n.hour,delete n.minute,delete n.timeZoneName),e===`hour`&&(delete n.minute,delete n.second),e===`minute`&&delete n.second,n}function Za(e){let t=e.querySelector(`[data-selected]`);if(t)return t.focus();let n=e.querySelector(`[data-today]`);if(n)return n.focus();let r=e.querySelector(`[data-radix-vue-calendar-day]`);if(r)return r.focus()}function Qa(e,t){var n;let r=ie();return H(()=>{r.value=e()},{...t,flush:(n=void 0,`sync`)}),ee(r)}function $a(e,t){let n,r,i,a=L(!0),o=()=>{a.value=!0,i()};V(e,o,{flush:`sync`});let s=typeof t==`function`?t:t.get,c=typeof t==`function`?void 0:t.set,l=f((e,t)=>(r=e,i=t,{get(){return a.value&&(n=s(),a.value=!1),r(),n},set(e){c?.(e)}}));return Object.isExtensible(l)&&(l.trigger=o),l}function eo(e){return g()?(j(e),!0):!1}function to(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return eo(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t)))}}function no(e){let t=!1,n,r=m(!0);return(...i)=>(t||(n=r.run(()=>e(...i)),t=!0),n)}function ro(e){let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return(...a)=>(t+=1,n||(r=m(!0),n=r.run(()=>e(...a))),eo(i),n)}function io(e){return typeof e==`function`?e():B(e)}function ao(e){if(!b(e))return I(e);let t=new Proxy({},{get(t,n,r){return B(Reflect.get(e.value,n,r))},set(t,n,r){return b(e.value[n])&&!b(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return I(t)}function oo(e){return ao(a(e))}const so=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;const co=e=>typeof e<`u`,lo=e=>e!=null,uo=Object.prototype.toString,fo=e=>uo.call(e)===`[object Object]`,po=()=>{},mo=ho();function ho(){var e,t;return so&&(e=window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(t=window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function go(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function _o(e,t={}){let n,r,i=po,a=e=>{clearTimeout(e),i(),i=po};return o=>{let s=io(e),c=io(t.maxWait);return n&&a(n),s<=0||c!==void 0&&c<=0?(r&&(a(r),r=null),Promise.resolve(o())):new Promise((e,l)=>{i=t.rejectOnCancel?l:e,c&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,e(o())},c)),n=setTimeout(()=>{r&&a(r),r=null,e(o())},s)})}}function vo(e){return h()}function yo(e,t=1e4){return f((n,r)=>{let i=io(e),a,o=()=>setTimeout(()=>{i=io(e),r()},io(t));return eo(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function bo(e,t=200,n={}){return go(_o(t,n),e)}function xo(e,t){vo()&&O(e,t)}function So(e,t=!0,n){vo()?A(e,n):t?e():w(e)}function Co(e,t,n={}){let{immediate:r=!0}=n,i=L(!1),a=null;function o(){a&&(clearTimeout(a),a=null)}function s(){i.value=!1,o()}function c(...n){o(),i.value=!0,a=setTimeout(()=>{i.value=!1,a=null,e(...n)},io(t))}return r&&(i.value=!0,so&&c()),eo(s),{isPending:ee(i),start:c,stop:s}}function wo(e=1e3,t={}){let{controls:n=!1,callback:r}=t,i=Co(r??po,e,t),o=a(()=>!i.isPending.value);return n?{ready:o,...i}:o}function To(e,t,n){let r=V(e,(...e)=>(w(()=>r()),t(...e)),n);return r}function Eo(e){var t;let n=io(e);return(t=n?.$el)??n}const Do=so?window:void 0;function Oo(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=Do):[t,n,r,i]=e,!t)return po;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=V(()=>[Eo(t),io(i)],([e,t])=>{if(o(),!e)return;let i=fo(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return eo(l),l}function ko(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ao(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=Do,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=ko(t);return Oo(i,a,e=>{e.repeat&&io(s)||c(e)&&n(e)},o)}function jo(){let e=L(!1),t=h();return t&&A(()=>{e.value=!0},t),e}function Mo(e){let t=jo();return a(()=>(t.value,!!e()))}function No(e,t,n={}){let{window:r=Do,...i}=n,o,s=Mo(()=>r&&`MutationObserver`in r),c=()=>{o&&(o.disconnect(),o=void 0)},l=a(()=>{let t=io(e),n=(Array.isArray(t)?t:[t]).map(Eo).filter(lo);return new Set(n)}),u=V(()=>l.value,e=>{c(),s.value&&e.size&&(o=new MutationObserver(t),e.forEach(e=>o.observe(e,i)))},{immediate:!0,flush:`post`}),d=()=>o?.takeRecords(),f=()=>{c(),u()};return eo(f),{isSupported:s,stop:f,takeRecords:d}}function Po(e={}){var t;let{window:n=Do,deep:r=!0,triggerOnRemoval:i=!1}=e,a=(t=e.document)??n?.document,o=()=>{var e;let t=a?.activeElement;if(r)for(;t!=null&&t.shadowRoot;)t=(e=t?.shadowRoot)?.activeElement;return t},s=L(),c=()=>{s.value=o()};return n&&(Oo(n,`blur`,e=>{e.relatedTarget===null&&c()},!0),Oo(n,`focus`,c,!0)),i&&No(a,e=>{e.filter(e=>e.removedNodes.length).map(e=>Array.from(e.removedNodes)).flat().forEach(e=>{e===s.value&&c()})},{childList:!0,subtree:!0}),c(),s}function Fo(e,t={}){let{immediate:n=!0,fpsLimit:r=void 0,window:i=Do}=t,a=L(!1),o=r?1e3/r:null,s=0,c=null;function l(t){if(!a.value||!i)return;s||=t;let n=t-s;if(o&&nnull,()=>t.proxy.$el);return N(n.trigger),A(n.trigger),n}function Ro(e,t,n={}){let{window:r=Do,...i}=n,o,s=Mo(()=>r&&`ResizeObserver`in r),c=()=>{o&&(o.disconnect(),o=void 0)},l=a(()=>Array.isArray(e)?e.map(e=>Eo(e)):[Eo(e)]),u=V(l,e=>{if(c(),s.value&&r){o=new ResizeObserver(t);for(let t of e)t&&o.observe(t,i)}},{immediate:!0,flush:`post`}),d=()=>{c(),u()};return eo(d),{isSupported:s,stop:d}}function zo(e,t={}){let n=Po(t),r=a(()=>Eo(e));return{focused:a(()=>r.value&&n.value?r.value.contains(n.value):!1)}}function Bo(e=Lo()){let t=ie(),n=()=>{let n=Eo(e);n&&(t.value=n.parentElement)};return So(n),V(()=>io(e),n),t}function q(e,t,n,r={}){var i,o,s;let{clone:c=!1,passive:l=!1,eventName:u,deep:d=!1,defaultValue:f,shouldEmit:p}=r,m=h(),g=n||m?.emit||(i=m?.$emit)?.bind(m)||(s=(o=m?.proxy)?.$emit)?.bind(m?.proxy),_=u;t||=`modelValue`,_||=`update:${t.toString()}`;let v=e=>c?typeof c==`function`?c(e):Io(e):e,y=()=>co(e[t])?v(e[t]):f,b=e=>{p?p(e)&&g(_,e):g(_,e)};if(l){let n=y(),r=L(n),i=!1;return V(()=>e[t],e=>{i||(i=!0,r.value=v(e),w(()=>i=!1))}),V(r,n=>{!i&&(n!==e[t]||d)&&b(n)},{deep:d}),r}else return a({get(){return y()},set(e){b(e)}})}function Vo(e){return e?e.flatMap(e=>e.type===t?Vo(e.children):[e]):[]}function J(){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}const Ho=[`INPUT`,`TEXTAREA`];function Uo(e,t,n,r={}){if(!t||r.enableIgnoredElement&&Ho.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-radix-vue-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=Wo(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function Wo(e,t,n,r=e.length){if(--r===0)return null;let i=e.indexOf(t),a=n.goForward?i+1:i-1;if(!n.loop&&(a<0||a>=e.length))return null;let o=(a+e.length)%e.length,s=e[o];return s?s.hasAttribute(`disabled`)&&s.getAttribute(`disabled`)!==`false`?Wo(e,s,n,r):s:null}function Go(e){if(typeof e!=`object`||!e)return!1;let 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 Ko(e,t,n=`.`,r){if(!Go(t))return Ko(e,{},n,r);let i=Object.assign({},t);for(let t in e){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:Go(a)&&Go(i[t])?i[t]=Ko(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function qo(e){return(...t)=>t.reduce((t,n)=>Ko(t,n,``,e),{})}const Jo=qo(),[Yo,Xo]=K(`ConfigProvider`),Zo=p({inheritAttrs:!1,__name:`ConfigProvider`,props:{dir:{default:`ltr`},scrollBody:{type:[Boolean,Object],default:!0},nonce:{default:void 0},useId:{type:Function,default:void 0}},setup(e){let t=e,{dir:n,scrollBody:r,nonce:i}=z(t);return Xo({dir:n,scrollBody:r,nonce:i,useId:t.useId}),(e,t)=>R(e.$slots,`default`)}});let Qo=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,$o=(e=21)=>{let t=``,n=e;for(;n--;)t+=Qo[Math.random()*64|0];return t};const es=ro(()=>{let e=L(new Map),t=L(),n=a(()=>{for(let t of e.value.values())if(t)return!0;return!1}),r=Yo({scrollBody:L(!0)}),i=null,o=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,document.body.style.pointerEvents=``,document.body.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=t.value??``,mo&&i?.(),t.value=void 0};return V(n,(e,n)=>{var a;if(!so)return;if(!e){n&&o();return}t.value===void 0&&(t.value=document.body.style.overflow);let s=window.innerWidth-document.documentElement.clientWidth,c={padding:s,margin:0},l=(a=r.scrollBody)!=null&&a.value?typeof r.scrollBody.value==`object`?Jo({padding:r.scrollBody.value.padding===!0?s:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?s:r.scrollBody.value.margin},c):c:{padding:0,margin:0};s>0&&(document.body.style.paddingRight=typeof l.padding==`number`?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin==`number`?`${l.margin}px`:String(l.margin),document.body.style.setProperty(`--scrollbar-width`,`${s}px`),document.body.style.overflow=`hidden`),mo&&(i=Oo(document,`touchmove`,e=>rs(e),{passive:!1})),w(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})},{immediate:!0,flush:`sync`}),e});function ts(e){let t=$o(6),n=es();n.value.set(t,e??!1);let r=a({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return xo(()=>{n.value.delete(t)}),r}function ns(e){let t=window.getComputedStyle(e);if(t.overflowX===`scroll`||t.overflowY===`scroll`||t.overflowX===`auto`&&e.clientWidth1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}const os=`data-radix-vue-collection-item`;function ss(e,t=os){let n=e??Symbol();return{createCollection:e=>{let r=L([]);function i(){let n=Eo(e);return n?r.value=Array.from(n.querySelectorAll(`[${t}]:not([data-disabled])`)):r.value=[]}return k(()=>{r.value=[]}),A(i),N(i),V(()=>e?.value,i,{immediate:!0}),F(n,r),r},injectCollection:()=>y(n,L([]))}}function cs(e){let t=L(e);function n(){return t.value}function r(e){t.value=e}function i(e,n){return new Mi(t.value,n).format(e)}function a(e,t=!0){return la(e)&&t?i(oa(e),{dateStyle:`long`,timeStyle:`long`}):i(oa(e),{dateStyle:`long`})}function o(e,n={}){return new Mi(t.value,{month:`long`,year:`numeric`,...n}).format(e)}function s(e,n={}){return new Mi(t.value,{month:`long`,...n}).format(e)}function c(){let e=cn(pn());return[1,2,3,4,5,6,7,8,9,10,11,12].map(t=>({label:s(oa(e.set({month:t}))),value:t}))}function l(e,n={}){return new Mi(t.value,{year:`numeric`,...n}).format(e)}function u(e,n){return ca(e)?new Mi(t.value,{...n,timeZone:e.timeZone}).formatToParts(oa(e)):new Mi(t.value,n).formatToParts(oa(e))}function d(e,n=`narrow`){return new Mi(t.value,{weekday:n}).format(e)}function f(e){var n;return(n=new Mi(t.value,{hour:`numeric`,minute:`numeric`}).formatToParts(e).find(e=>e.type===`dayPeriod`))?.value===`PM`?`PM`:`AM`}let p={year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`};function m(e,t,n={}){let r={...p,...n},i=u(e,r).find(e=>e.type===t);return i?i.value:``}return{setLocale:r,getLocale:n,fullMonth:s,fullYear:l,fullMonthAndYear:o,toParts:u,custom:i,part:m,dayPeriod:f,selectedDate:a,dayOfWeek:d,getMonths:c}}function Y(e){let t=Yo({dir:L(`ltr`)});return a(()=>{var n;return e?.value||(n=t.dir)?.value||`ltr`})}function ls(e){let t=h(),n=t?.type.emits,i={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(t=>{i[oe(r(t))]=(...n)=>e(t,...n)}),i}let us=0;function ds(){H(e=>{if(!so)return;let t=document.querySelectorAll(`[data-radix-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??fs()),document.body.insertAdjacentElement(`beforeend`,t[1]??fs()),us++,e(()=>{us===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),us--})})}function fs(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function ps(e){return a(()=>{var t;return io(e)?!!((t=Eo(e))!=null&&t.closest(`form`)):!0})}function ms(e){let t=h(),n=Object.keys(t?.type.props??{}).reduce((e,n)=>{let r=(t?.type.props[n]).default;return r!==void 0&&(e[n]=r),e},{}),i=le(e);return a(()=>{let e={},a=t?.vnode.props??{};return Object.keys(a).forEach(t=>{e[r(t)]=a[t]}),Object.keys({...n,...e}).reduce((e,t)=>(i.value[t]!==void 0&&(e[t]=i.value[t]),e),{})})}function hs(e,t){let n=ms(e),r=t?ls(t):{};return a(()=>({...n.value,...r}))}function X(){let e=h(),t=L(),n=a(()=>{var e,n;return[`#text`,`#comment`].includes((e=t.value)?.$el.nodeName)?(n=t.value)?.$el.nextElementSibling:Eo(t)}),r=Object.assign({},e.exposed),i={};for(let t in e.props)Object.defineProperty(i,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(r).length>0)for(let e in r)Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>r[e]});Object.defineProperty(i,`$el`,{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function o(n){t.value=n,n&&(Object.defineProperty(i,`$el`,{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),e.exposed=i)}return{forwardRef:o,currentRef:t,currentElement:n}}function gs(e,t){let n=yo(!1,300),r=L(null),i=to();function a(){r.value=null,n.value=!1}function o(e,t){let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=_s(a,i.getBoundingClientRect()),s=vs(a,o),c=ys(t.getBoundingClientRect()),l=xs([...s,...c]);r.value=l,n.value=!0}return H(n=>{if(e.value&&t.value){let r=e=>o(e,t.value),i=t=>o(t,e.value);e.value.addEventListener(`pointerleave`,r),t.value.addEventListener(`pointerleave`,i),n(()=>{var n,a;(n=e.value)==null||n.removeEventListener(`pointerleave`,r),(a=t.value)==null||a.removeEventListener(`pointerleave`,i)})}}),H(n=>{var o;if(r.value){let s=n=>{var o,s;if(!r.value)return;let c=n.target,l={x:n.clientX,y:n.clientY},u=(o=e.value)?.contains(c)||(s=t.value)?.contains(c),d=!bs(l,r.value),f=!!c.closest(`[data-grace-area-trigger]`);u?a():(d||f)&&(a(),i.trigger())};(o=e.value)==null||o.ownerDocument.addEventListener(`pointermove`,s),n(()=>{var t;return(t=e.value)?.ownerDocument.removeEventListener(`pointermove`,s)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function _s(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function vs(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ys(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function bs(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function xs(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y?1:0),Ss(t)}function Ss(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Cs=function(e){if(typeof document>`u`)return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ws=new WeakMap,Ts=new WeakMap,Es={},Ds=0,Os=function(e){return e&&(e.host||Os(e.parentNode))},ks=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Os(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},As=function(e,t,n,r){var i=ks(t,Array.isArray(e)?e:[e]);Es[n]||(Es[n]=new WeakMap);var a=Es[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(ws.get(e)||0)+1,l=(a.get(e)||0)+1;ws.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ts.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ds++,function(){o.forEach(function(e){var t=ws.get(e)-1,i=a.get(e)-1;ws.set(e,t),a.set(e,i),t||(Ts.has(e)||e.removeAttribute(r),Ts.delete(e)),i||e.removeAttribute(n)}),Ds--,Ds||(ws=new WeakMap,ws=new WeakMap,Ts=new WeakMap,Es={})}},js=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=Cs(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live]`))),As(r,i,n,`aria-hidden`)):function(){return null}};function Ms(e){let t;V(()=>Eo(e),e=>{e?t=js(e):t&&t()}),M(()=>{t&&t()})}let Ns=0;function Z(e,t=`radix`){if(e)return e;let n=Yo({useId:void 0});return de?`${t}-${de()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++Ns}`}function Ps(e,t){let n=L(),r=(r,i)=>{if(t.multiple&&Array.isArray(e.value))if(t.selectionBehavior===`replace`)e.value=[r],n.value=r;else{let t=e.value.findIndex(e=>i(e));t===-1?e.value.push(r):e.value.splice(t,1)}else t.selectionBehavior===`replace`?e.value={...r}:!Array.isArray(e.value)&&i(e.value)?e.value=void 0:e.value={...r};return e.value};function i(r,i,a,o){var s;if(!(n!=null&&n.value)||!t.multiple||!Array.isArray(e.value))return;let c=(s=a().filter(e=>e.ref.dataset.disabled!==``).find(e=>e.ref===i))?.value;if(!c)return;let l=null;switch(r){case`prev`:case`next`:l=ja(o,n.value,c);break;case`first`:l=ja(o,n.value,o?.[0]);break;case`last`:l=ja(o,n.value,o?.[o.length-1]);break}e.value=l}return{firstValue:n,onSelectItem:r,handleMultipleReplace:i}}function Fs(e){let t=L(),n=a(()=>{var e;return(e=t.value)?.width??0}),r=a(()=>{var e;return(e=t.value)?.height??0});return A(()=>{let n=Eo(e);if(n){t.value={width:n.offsetWidth,height:n.offsetHeight};let e=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let r=e[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=n.offsetWidth,a=n.offsetHeight;t.value={width:i,height:a}});return e.observe(n,{box:`border-box`}),()=>e.unobserve(n)}else t.value=void 0}),{width:n,height:r}}function Is(e,t){let n=L(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}const Ls=`data-item-text`;function Rs(e){let t=yo(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(!(e!=null&&e.value)&&!r)return;t.value+=n;let i=e?.value??r,a=J(),o=i.map(e=>{var t;return{ref:e,textValue:(t=(e.querySelector(`[${Ls}]`)??e).textContent)?.trim()??``}}),s=o.find(e=>e.ref===a),c=o.map(e=>e.textValue),l=Bs(c,t.value,s?.textValue),u=o.find(e=>e.textValue===l);return u&&u.ref.focus(),u?.ref},resetTypeahead:()=>{t.value=``}}}function zs(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Bs(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zs(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Vs(){return{ALT:`Alt`,ARROW_DOWN:`ArrowDown`,ARROW_LEFT:`ArrowLeft`,ARROW_RIGHT:`ArrowRight`,ARROW_UP:`ArrowUp`,BACKSPACE:`Backspace`,CAPS_LOCK:`CapsLock`,CONTROL:`Control`,DELETE:`Delete`,END:`End`,ENTER:`Enter`,ESCAPE:`Escape`,F1:`F1`,F10:`F10`,F11:`F11`,F12:`F12`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,HOME:`Home`,META:`Meta`,PAGE_DOWN:`PageDown`,PAGE_UP:`PageUp`,SHIFT:`Shift`,SPACE:` `,TAB:`Tab`,CTRL:`Control`,ASTERISK:`*`,SPACE_CODE:`Space`}}const Hs=p({name:`PrimitiveSlot`,inheritAttrs:!1,setup(t,{attrs:n,slots:r}){return()=>{var t,a;if(!r.default)return null;let o=Vo(r.default()),s=o.findIndex(t=>t.type!==e);if(s===-1)return o;let c=o[s];(t=c.props)==null||delete t.ref;let l=c.props?C(n,c.props):n;n.class&&(a=c.props)!=null&&a.class&&delete c.props.class;let u=i(c,l);for(let e in l)e.startsWith(`on`)&&(u.props||={},u.props[e]=l[e]);return o.length===1?u:(o[s]=u,o)}}}),Q=p({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&[`area`,`img`,`input`].includes(r)?()=>v(r,t):r===`template`?()=>v(Hs,t,{default:n.default}):()=>v(e.as,t,{default:n.default})}});function Us(){let e=L(),t=a(()=>{var t,n;return[`#text`,`#comment`].includes((t=e.value)?.$el.nodeName)?(n=e.value)?.$el.nextElementSibling:Eo(e)});return{primitiveElement:e,currentElement:t}}const[Ws,Gs]=K(`CollapsibleRoot`),Ks=p({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=q(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),a=q(r,`disabled`);return Gs({contentId:``,disabled:a,open:i,onOpenToggle:()=>{i.value=!i.value}}),t({open:i}),X(),(e,t)=>(P(),s(B(Q),{as:e.as,"as-child":r.asChild,"data-state":B(i)?`open`:`closed`,"data-disabled":B(a)?``:void 0},{default:U(()=>[R(e.$slots,`default`,{open:B(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),qs=p({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=Ws();return(e,r)=>{var i,a;return P(),s(B(Q),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":B(n).contentId,"aria-expanded":B(n).open.value,"data-state":B(n).open.value?`open`:`closed`,"data-disabled":(i=B(n).disabled)!=null&&i.value?``:void 0,disabled:(a=B(n).disabled)?.value,onClick:B(n).onOpenToggle},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`])}}});function Js(e,t){var n;let r=L({}),i=L(`none`),o=L(e),s=e.value?`mounted`:`unmounted`,c,l=(n=t.value)?.ownerDocument.defaultView??Do,{state:u,dispatch:d}=Is(s,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),f=e=>{var n;if(so){let r=new CustomEvent(e,{bubbles:!1,cancelable:!1});(n=t.value)==null||n.dispatchEvent(r)}};V(e,async(e,n)=>{var a;let o=n!==e;if(await w(),o){let o=i.value,s=Ys(t.value);e?(d(`MOUNT`),f(`enter`),s===`none`&&f(`after-enter`)):s===`none`||(a=r.value)?.display===`none`?(d(`UNMOUNT`),f(`leave`),f(`after-leave`)):n&&o!==s?(d(`ANIMATION_OUT`),f(`leave`)):(d(`UNMOUNT`),f(`after-leave`))}},{immediate:!0});let p=e=>{let n=Ys(t.value),r=n.includes(e.animationName),i=u.value===`mounted`?`enter`:`leave`;if(e.target===t.value&&r&&(f(`after-${i}`),d(`ANIMATION_END`),!o.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,c=l?.setTimeout(()=>{var n;(n=t.value)?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}e.target===t.value&&n===`none`&&d(`ANIMATION_END`)},m=e=>{e.target===t.value&&(i.value=Ys(t.value))},h=V(t,(e,t)=>{e?(r.value=getComputedStyle(e),e.addEventListener(`animationstart`,m),e.addEventListener(`animationcancel`,p),e.addEventListener(`animationend`,p)):(d(`ANIMATION_END`),c!==void 0&&l?.clearTimeout(c),t?.removeEventListener(`animationstart`,m),t?.removeEventListener(`animationcancel`,p),t?.removeEventListener(`animationend`,p))},{immediate:!0}),g=V(u,()=>{let e=Ys(t.value);i.value=u.value===`mounted`?e:`none`});return M(()=>{h(),g()}),{isPresent:a(()=>[`mounted`,`unmountSuspended`].includes(u.value))}}function Ys(e){return e&&getComputedStyle(e).animationName||`none`}const Xs=p({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var r;let{present:i,forceMount:a}=z(e),o=L(),{isPresent:s}=Js(i,o);n({present:s});let c=t.default({present:s});c=Vo(c||[]);let l=h();if(c&&c?.length>1){let e=(r=l?.parent)!=null&&r.type.name?`<${l.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` 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(e=>` - ${e}`).join(` +import{Comment as e,Fragment as t,Teleport as n,camelize as r,cloneVNode as i,computed as a,createBaseVNode as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createTextVNode as u,createVNode as d,customRef as f,defineComponent as p,effectScope as m,getCurrentInstance as h,getCurrentScope as g,guardReactiveProps as _,h as v,inject as y,isRef as b,markRaw as x,mergeDefaults as S,mergeProps as C,nextTick as w,normalizeProps as T,normalizeStyle as E,onBeforeMount as D,onBeforeUnmount as O,onBeforeUpdate as k,onMounted as A,onScopeDispose as j,onUnmounted as M,onUpdated as N,openBlock as P,provide as F,reactive as I,readonly as ee,ref as L,renderList as te,renderSlot as R,resolveDynamicComponent as ne,shallowReadonly as re,shallowRef as ie,toDisplayString as ae,toHandlerKey as oe,toHandlers as se,toRaw as ce,toRef as le,toRefs as z,triggerRef as ue,unref as B,useId as de,useSlots as fe,vModelSelect as pe,vShow as me,watch as V,watchEffect as H,watchPostEffect as he,watchSyncEffect as ge,withCtx as U,withDirectives as _e,withKeys as W,withModifiers as G}from"./index-DKziOBM4.js";import{arrow as ve,computePosition as ye,createCoords as be,flip as xe,floor as Se,hide as Ce,limitShift as we,max as Te,min as Ee,offset as De,rectToClientRect as Oe,round as ke,shift as Ae,size as je}from"./src-CmPNYgc5.js";function Me(){return typeof window<`u`}function Ne(e){return Ie(e)?(e.nodeName||``).toLowerCase():`#document`}function Pe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fe(e){var t;return(t=(Ie(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ie(e){return Me()?e instanceof Node||e instanceof Pe(e).Node:!1}function Le(e){return Me()?e instanceof Element||e instanceof Pe(e).Element:!1}function Re(e){return Me()?e instanceof HTMLElement||e instanceof Pe(e).HTMLElement:!1}function ze(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Pe(e).ShadowRoot}function Be(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function Ve(e){return[`table`,`td`,`th`].includes(Ne(e))}function He(e){return[`:popover-open`,`:modal`].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ue(e){let t=Ge(),n=Le(e)?qe(e):e;return[`transform`,`translate`,`scale`,`rotate`,`perspective`].some(e=>n[e]?n[e]!==`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(e=>(n.willChange||``).includes(e))||[`paint`,`layout`,`strict`,`content`].some(e=>(n.contain||``).includes(e))}function We(e){let t=Ye(e);for(;Re(t)&&!Ke(t);){if(Ue(t))return t;if(He(t))return null;t=Ye(t)}return null}function Ge(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}function Ke(e){return[`html`,`body`,`#document`].includes(Ne(e))}function qe(e){return Pe(e).getComputedStyle(e)}function Je(e){return Le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ye(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ze(e)&&e.host||Fe(e);return ze(t)?t.host:t}function Xe(e){let t=Ye(e);return Ke(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&Be(t)?t:Xe(t)}function Ze(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let i=Xe(e),a=i===(r=e.ownerDocument)?.body,o=Pe(i);if(a){let e=Qe(o);return t.concat(o,o.visualViewport||[],Be(i)?i:[],e&&n?Ze(e):[])}return t.concat(i,Ze(i,[],n))}function Qe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $e(e){let t=qe(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Re(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ke(n)!==a||ke(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function et(e){return Le(e)?e:e.contextElement}function tt(e){let t=et(e);if(!Re(t))return be(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$e(t),o=(a?ke(n.width):n.width)/r,s=(a?ke(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const nt=be(0);function rt(e){let t=Pe(e);return!Ge()||!t.visualViewport?nt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function it(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pe(e)?!1:t}function at(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=et(e),o=be(1);t&&(r?Le(r)&&(o=tt(r)):o=tt(e));let s=it(a,n,r)?rt(a):be(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Pe(a),t=r&&Le(r)?Pe(r):r,n=e,i=Qe(n);for(;i&&r&&t!==n;){let e=tt(i),t=i.getBoundingClientRect(),r=qe(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Pe(i),i=Qe(n)}}return Oe({width:u,height:d,x:c,y:l})}function ot(e,t){let n=Je(e).scrollLeft;return t?t.left+n:at(Fe(e)).left+n}function st(e,t,n){n===void 0&&(n=!1);let r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:ot(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function ct(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Fe(r),s=t?He(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=be(1),u=be(0),d=Re(r);if((d||!d&&!a)&&((Ne(r)!==`body`||Be(o))&&(c=Je(r)),Re(r))){let e=at(r);l=tt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?st(o,c,!0):be(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function lt(e){return Array.from(e.getClientRects())}function ut(e){let t=Fe(e),n=Je(e),r=e.ownerDocument.body,i=Te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ot(e),s=-n.scrollTop;return qe(r).direction===`rtl`&&(o+=Te(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function dt(e,t){let n=Pe(e),r=Fe(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ge();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}function ft(e,t){let n=at(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Re(e)?tt(e):be(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,c=i*a.x,l=r*a.y;return{width:o,height:s,x:c,y:l}}function pt(e,t,n){let r;if(t===`viewport`)r=dt(e,n);else if(t===`document`)r=ut(Fe(e));else if(Le(t))r=ft(t,n);else{let n=rt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Oe(r)}function mt(e,t){let n=Ye(e);return n===t||!Le(n)||Ke(n)?!1:qe(n).position===`fixed`||mt(n,t)}function ht(e,t){let n=t.get(e);if(n)return n;let r=Ze(e,[],!1).filter(e=>Le(e)&&Ne(e)!==`body`),i=null,a=qe(e).position===`fixed`,o=a?Ye(e):e;for(;Le(o)&&!Ke(o);){let t=qe(o),n=Ue(o);!n&&t.position===`fixed`&&(i=null);let s=a?!n&&!i:!n&&t.position===`static`&&!!i&&[`absolute`,`fixed`].includes(i.position)||Be(o)&&!n&&mt(e,o);s?r=r.filter(e=>e!==o):i=t,o=Ye(o)}return t.set(e,r),r}function gt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=n===`clippingAncestors`?He(t)?[]:ht(t,this._c):[].concat(n),o=[...a,r],s=o[0],c=o.reduce((e,n)=>{let r=pt(t,n,i);return e.top=Te(r.top,e.top),e.right=Ee(r.right,e.right),e.bottom=Ee(r.bottom,e.bottom),e.left=Te(r.left,e.left),e},pt(t,s,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _t(e){let{width:t,height:n}=$e(e);return{width:t,height:n}}function vt(e,t,n){let r=Re(t),i=Fe(t),a=n===`fixed`,o=at(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=be(0);if(r||!r&&!a)if((Ne(t)!==`body`||Be(i))&&(s=Je(t)),r){let e=at(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&(c.x=ot(i));let l=i&&!r&&!a?st(i,s):be(0),u=o.left+s.scrollLeft-c.x-l.x,d=o.top+s.scrollTop-c.y-l.y;return{x:u,y:d,width:o.width,height:o.height}}function yt(e){return qe(e).position===`static`}function bt(e,t){if(!Re(e)||qe(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Fe(e)===n&&(n=n.ownerDocument.body),n}function xt(e,t){let n=Pe(e);if(He(e))return n;if(!Re(e)){let t=Ye(e);for(;t&&!Ke(t);){if(Le(t)&&!yt(t))return t;t=Ye(t)}return n}let r=bt(e,t);for(;r&&Ve(r)&&yt(r);)r=bt(r,t);return r&&Ke(r)&&yt(r)&&!Ue(r)?n:r||We(e)||n}const St=async function(e){let t=this.getOffsetParent||xt,n=this.getDimensions,r=await n(e.floating);return{reference:vt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ct(e){return qe(e).direction===`rtl`}const wt={convertOffsetParentRelativeRectToViewportRelativeRect:ct,getDocumentElement:Fe,getClippingRect:gt,getOffsetParent:xt,getElementRects:St,getClientRects:lt,getDimensions:_t,getScale:tt,isElement:Le,isRTL:Ct};function Tt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Et(e,t){let n=null,r,i=Fe(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Se(d),h=Se(i.clientWidth-(u+f)),g=Se(i.clientHeight-(d+p)),_=Se(u),v=-m+`px `+-h+`px `+-g+`px `+-_+`px`,y={rootMargin:v,threshold:Te(0,Ee(1,c))||1},b=!0;function x(t){let n=t[0].intersectionRatio;if(n!==c){if(!b)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Tt(l,e.getBoundingClientRect())&&o(),b=!1}try{n=new IntersectionObserver(x,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,y)}n.observe(e)}return o(!0),a}function Dt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=et(e),u=i||a?[...l?Ze(l):[],...Ze(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Et(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?at(e):null;c&&g();function g(){let t=at(e);h&&!Tt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const Ot=De,kt=Ae,At=xe,jt=je,Mt=Ce,Nt=ve,Pt=we,Ft=(e,t,n)=>{let r=new Map,i={platform:wt,...n},a={...i.platform,_c:r};return ye(e,t,{...i,platform:a})};function It(e){return typeof e==`object`&&!!e&&`$el`in e}function Lt(e){if(It(e)){let t=e.$el;return Ie(t)&&Ne(t)===`#comment`?null:t}return e}function Rt(e){return typeof e==`function`?e():B(e)}function zt(e){return{name:`arrow`,options:e,fn(t){let n=Lt(Rt(e.element));return n==null?{}:Nt({element:n,padding:e.padding}).fn(t)}}}function Bt(e){if(typeof window>`u`)return 1;let t=e.ownerDocument.defaultView||window;return t.devicePixelRatio||1}function Vt(e,t){let n=Bt(e);return Math.round(t*n)/n}function Ht(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=a(()=>{var e;return(e=Rt(n.open))??!0}),o=a(()=>Rt(n.middleware)),s=a(()=>{var e;return(e=Rt(n.placement))??`bottom`}),c=a(()=>{var e;return(e=Rt(n.strategy))??`absolute`}),l=a(()=>{var e;return(e=Rt(n.transform))??!0}),u=a(()=>Lt(e.value)),d=a(()=>Lt(t.value)),f=L(0),p=L(0),m=L(c.value),h=L(s.value),_=ie({}),v=L(!1),y=a(()=>{let e={position:m.value,left:`0`,top:`0`};if(!d.value)return e;let t=Vt(d.value,f.value),n=Vt(d.value,p.value);return l.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...Bt(d.value)>=1.5&&{willChange:`transform`}}:{position:m.value,left:t+`px`,top:n+`px`}}),b;function x(){if(u.value==null||d.value==null)return;let e=i.value;Ft(u.value,d.value,{middleware:o.value,placement:s.value,strategy:c.value}).then(t=>{f.value=t.x,p.value=t.y,m.value=t.strategy,h.value=t.placement,_.value=t.middlewareData,v.value=e!==!1})}function S(){typeof b==`function`&&(b(),b=void 0)}function C(){if(S(),r===void 0){x();return}if(u.value!=null&&d.value!=null){b=r(u.value,d.value,x);return}}function w(){i.value||(v.value=!1)}return V([o,s,c,i],x,{flush:`sync`}),V([u,d],C,{flush:`sync`}),V(i,w,{flush:`sync`}),g()&&j(S),{x:re(f),y:re(p),strategy:re(m),placement:re(h),middlewareData:re(_),isPositioned:re(v),floatingStyles:y,update:x}}function Ut(e,t){return e-t*Math.floor(e/t)}const Wt=1721426;function Gt(e,t,n,r){t=qt(e,t);let i=t-1,a=-2;return n<=2?a=0:Kt(t)&&(a=-1),Wt-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function Kt(e){return e%4==0&&(e%100!=0||e%400==0)}function qt(e,t){return e===`BC`?1-t:t}function Jt(e){let t=`AD`;return e<=0&&(t=`BC`,e=1-e),[t,e]}const Yt={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};var Xt=class{fromJulianDay(e){let t=e,n=t-Wt,r=Math.floor(n/146097),i=Ut(n,146097),a=Math.floor(i/36524),o=Ut(i,36524),s=Math.floor(o/1461),c=Ut(o,1461),l=Math.floor(c/365),u=r*400+a*100+s*4+l+(a!==4&&l!==4?1:0),[d,f]=Jt(u),p=t-Gt(d,f,1,1),m=2;t0&&t===pn())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=Cn(e,t),c=bn(n,r,i,a,o,s,0);return c-Math.floor(e/1e3)*1e3}const Sn=new Map;function Cn(e,t){let n=Sn.get(t);n||(n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),Sn.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let e of r)e.type!==`literal`&&(i[e.type]=e.value);return{year:i.era===`BC`||i.era===`B`?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour===`24`?0:+i.hour,minute:+i.minute,second:+i.second}}const wn=864e5;function Tn(e,t,n,r){let i=n===r?[n]:[n,r];return i.filter(n=>En(e,t,n))}function En(e,t,n){let r=Cn(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function Dn(e,t,n=`compatible`){let r=jn(e);if(t===`UTC`)return yn(r);if(t===pn()&&n===`compatible`){r=Mn(r,new Xt);let e=new Date,t=qt(r.era,r.year);return e.setFullYear(t,r.month-1,r.day),e.setHours(r.hour,r.minute,r.second,r.millisecond),e.getTime()}let i=yn(r),a=xn(i-wn,t),o=xn(i+wn,t),s=Tn(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case`compatible`:case`earlier`:return s[0];case`later`:return s[s.length-1];case`reject`:throw RangeError(`Multiple possible absolute times found`)}switch(n){case`earlier`:return Math.min(i-a,i-o);case`compatible`:case`later`:return Math.max(i-a,i-o);case`reject`:throw RangeError(`No such absolute time found`)}}function On(e,t,n=`compatible`){return new Date(Dn(e,t,n))}function kn(e,t){let n=xn(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new yr(i<1?`BC`:`AD`,i<1?-i+1:i,a,o,t,n,s,c,l,u)}function An(e){return new hr(e.calendar,e.era,e.year,e.month,e.day)}function jn(e,t){let n=0,r=0,i=0,a=0;if(`timeZone`in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if(`hour`in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new _r(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function Mn(e,t){if(nn(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Hn(r),r}function Nn(e,t,n){if(e instanceof yr)return e.timeZone===t?e:Fn(e,t);let r=Dn(e,t,n);return kn(r,t)}function Pn(e){let t=yn(e)-e.offset;return new Date(t)}function Fn(e,t){let n=yn(e)-e.offset;return Mn(kn(n,t),e.calendar)}const In=36e5;function Ln(e,t){let n=e.copy(),r=`hour`in n?Xn(n,t):0;Rn(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,zn(n),Vn(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,Bn(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var a,o;let e=(a=(o=n.calendar).isInverseEra)?.call(o,n);n.year=i,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Rn(e,t){var n,r;(n=(r=e.calendar).isInverseEra)?.call(r,e)&&(t=-t),e.year+=t}function zn(e){for(;e.month<1;)Rn(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Rn(e,1)}function Bn(e){for(;e.day<1;)e.month--,zn(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,zn(e)}function Vn(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Hn(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Vn(e)}function Un(e){let t={};for(let n in e)typeof e[n]==`number`&&(t[n]=-e[n]);return t}function Wn(e,t){return Ln(e,Un(t))}function Gn(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Hn(n),n}function Kn(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),Jn(n),n}function qn(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Yn(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Yn(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Yn(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Yn(e.hour,24),t}function Jn(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Yn(e,t){let n=e%t;return n<0&&(n+=t),n}function Xn(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,qn(e)}function Zn(e,t,n,r){let i=e.copy();switch(t){case`era`:{let t=e.calendar.getEras(),a=t.indexOf(e.era);if(a<0)throw Error(`Invalid era: `+e.era);a=$n(a,n,0,t.length-1,r?.round),i.era=t[a],Hn(i);break}case`year`:var a,o;(a=(o=i.calendar).isInverseEra)?.call(o,i)&&(n=-n),i.year=$n(e.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case`month`:i.month=$n(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case`day`:i.day=$n(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error(`Unsupported field `+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),Hn(i),i}function Qn(e,t,n,r){let i=e.copy();switch(t){case`hour`:{let t=e.hour,a=0,o=23;if(r?.hourCycle===12){let e=t>=12;a=e?12:0,o=e?23:11}i.hour=$n(t,n,a,o,r?.round);break}case`minute`:i.minute=$n(e.minute,n,0,59,r?.round);break;case`second`:i.second=$n(e.second,n,0,59,r?.round);break;case`millisecond`:i.millisecond=$n(e.millisecond,n,0,999,r?.round);break;default:throw Error(`Unsupported field `+t)}return i}function $n(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,er&&(e=n+(e-r-1));return e}function er(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let r=Ln(jn(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Dn(r,e.timeZone)}else n=yn(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=kn(n,e.timeZone);return Mn(r,e.calendar)}function tr(e,t){return er(e,Un(t))}function nr(e,t,n,r){switch(t){case`hour`:{let t=0,i=23;if(r?.hourCycle===12){let n=e.hour>=12;t=n?12:0,i=n?23:11}let a=jn(e),o=Mn(Kn(a,{hour:t}),new Xt),s=[Dn(o,e.timeZone,`earlier`),Dn(o,e.timeZone,`later`)].filter(t=>kn(t,e.timeZone).day===o.day)[0],c=Mn(Kn(a,{hour:i}),new Xt),l=[Dn(c,e.timeZone,`earlier`),Dn(c,e.timeZone,`later`)].filter(t=>kn(t,e.timeZone).day===c.day).pop(),u=yn(e)-e.offset,d=Math.floor(u/In),f=u%In;return u=$n(d,n,Math.floor(s/In),Math.floor(l/In),r?.round)*In+f,Mn(kn(u,e.timeZone),e.calendar)}case`minute`:case`second`:case`millisecond`:return Qn(e,t,n,r);case`era`:case`year`:case`month`:case`day`:{let i=Zn(jn(e),t,n,r),a=Dn(i,e.timeZone);return Mn(kn(a,e.timeZone),e.calendar)}default:throw Error(`Unsupported field `+t)}}function rr(e,t,n){let r=jn(e),i=Kn(Gn(r,t),t);if(i.compare(r)===0)return e;let a=Dn(i,e.timeZone,n);return Mn(kn(a,e.timeZone),e.calendar)}const ir=[`hours`,`minutes`,`seconds`],ar=[`years`,`months`,`weeks`,`days`,...ir];function or(e){return`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}:${String(e.second).padStart(2,`0`)}${e.millisecond?String(e.millisecond/1e3).slice(1):``}`}function sr(e){let t=Mn(e,new Xt),n;return n=t.era===`BC`?t.year===1?`0000`:`-`+String(Math.abs(1-t.year)).padStart(6,`00`):String(t.year).padStart(4,`0`),`${n}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function cr(e){return`${sr(e)}T${or(e)}`}function lr(e){let t=Math.sign(e)<0?`-`:`+`;e=Math.abs(e);let n=Math.floor(e/36e5),r=e%36e5/6e4;return`${t}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`}function ur(e){return`${cr(e)}${lr(e.offset)}[${e.timeZone}]`}function dr(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function fr(e,t,n){dr(e,t),t.set(e,n)}function pr(e){let t=typeof e[0]==`object`?e.shift():new Xt,n;if(typeof e[0]==`string`)n=e.shift();else{let e=t.getEras();n=e[e.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var mr=new WeakMap,hr=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(e){return Ln(this,e)}subtract(e){return Wn(this,e)}set(e){return Gn(this,e)}cycle(e,t,n){return Zn(this,e,t,n)}toDate(e){return On(this,e)}toString(){return sr(this)}compare(e){return ln(this,e)}constructor(...e){fr(this,mr,{writable:!0,value:void 0});let[t,n,r,i,a]=pr(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,Hn(this)}},gr=new WeakMap,_r=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return Ln(this,e)}subtract(e){return Wn(this,e)}set(e){return Gn(Kn(this,e),e)}cycle(e,t,n){switch(e){case`era`:case`year`:case`month`:case`day`:return Zn(this,e,t,n);default:return Qn(this,e,t,n)}}toDate(e,t){return On(this,e,t)}toString(){return cr(this)}compare(e){let t=ln(this,e);return t===0?un(this,jn(e)):t}constructor(...e){fr(this,gr,{writable:!0,value:void 0});let[t,n,r,i,a]=pr(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Hn(this)}},vr=new WeakMap,yr=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return er(this,e)}subtract(e){return tr(this,e)}set(e,t){return rr(this,e,t)}cycle(e,t,n){return nr(this,e,t,n)}toDate(){return Pn(this)}toString(){return ur(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-Nn(e,this.timeZone).toDate().getTime()}constructor(...e){fr(this,vr,{writable:!0,value:void 0});let[t,n,r,i,a]=pr(e),o=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.timeZone=o,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Hn(this)}};const br=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],xr=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],Sr=[1867,1911,1925,1988,2018],Cr=[`meiji`,`taisho`,`showa`,`heisei`,`reiwa`];function wr(e){let t=br.findIndex(([t,n,r])=>e.year=0){let[,n,r]=br[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return Cr}getYearsInEra(e){let t=Cr.indexOf(e.era),n=br[t],r=br[t+1];if(r==null)return 9999-n[0]+1;let i=r[0]-n[0];return(e.month0?[`minguo`,t]:[`before_minguo`,1-t]}var Pr=class extends Xt{fromJulianDay(e){let t=super.fromJulianDay(e),n=qt(t.era,t.year),[r,i]=Nr(n);return new hr(this,r,i,t.month,t.day)}toJulianDay(e){return super.toJulianDay(Fr(e))}getEras(){return[`before_minguo`,`minguo`]}balanceDate(e){let[t,n]=Nr(Mr(e));e.era=t,e.year=n}isInverseEra(e){return e.era===`before_minguo`}getDaysInMonth(e){return super.getDaysInMonth(Fr(e))}getYearsInEra(e){return e.era===`before_minguo`?9999:9999-jr}constructor(...e){super(...e),this.identifier=`roc`}};function Fr(e){let[t,n]=Jt(Mr(e));return new hr(t,n,e.month,e.day)}const Ir=1948320,Lr=[0,31,62,93,124,155,186,216,246,276,306,336];var Rr=class{fromJulianDay(e){let t=e-Ir,n=1+Math.floor((33*t+3)/12053),r=365*(n-1)+Math.floor((8*n+21)/33),i=t-r,a=i<216?Math.floor(i/31):Math.floor((i-6)/30),o=i-Lr[a]+1;return new hr(this,n,a+1,o)}toJulianDay(e){let t=Ir-1+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=Lr[e.month-1],t+=e.day,t}getMonthsInYear(){return 12}getDaysInMonth(e){if(e.month<=6)return 31;if(e.month<=11)return 30;let t=Ut(25*e.year+11,33)<8;return t?30:29}getEras(){return[`AP`]}getYearsInEra(){return 9377}constructor(){this.identifier=`persian`}};const zr=78,Br=80;var Vr=class extends Xt{fromJulianDay(e){let t=super.fromJulianDay(e),n=t.year-zr,r=e-Gt(t.era,t.year,1,1),i;r=8&&(a+=(e.month-7)*30),a+=e.day-1,a)}getDaysInMonth(e){return e.month===1&&Kt(e.year+zr)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return[`saka`]}balanceDate(){}constructor(...e){super(...e),this.identifier=`indian`}};const Hr=1948440,Ur=1948439,Wr=1300,Gr=1600,Kr=460322;function qr(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function Jr(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),i=Math.min(12,Math.ceil((n-(29+qr(t,r,1,1)))/29.5)+1),a=n-qr(t,r,i,1)+1;return new hr(e,r,i,a)}function Yr(e){return(14+11*e)%30<11}var Xr=class{fromJulianDay(e){return Jr(this,Hr,e)}toJulianDay(e){return qr(Hr,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return e.month===12&&Yr(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return Yr(e.year)?355:354}getYearsInEra(){return 9665}getEras(){return[`AH`]}constructor(){this.identifier=`islamic-civil`}},Zr=class extends Xr{fromJulianDay(e){return Jr(this,Ur,e)}toJulianDay(e){return qr(Ur,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier=`islamic-tbla`}};const Qr=`qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=`;let $r,ei;function ti(e){return Kr+ei[e-Wr]}function ni(e,t){let n=e-Wr,r=1<<11-(t-1);return($r[n]&r)===0?29:30}function ri(e,t){let n=ti(e);for(let r=1;rr)return super.fromJulianDay(e);{let e=Wr-1,n=1,r=1;for(;r>0;){e++,r=t-ti(e)+1;let i=ii(e);if(r===i){n=12;break}else if(rt;)r-=t,n++,t=ni(e,n);break}}return new hr(this,e,n,t-ri(e,n)+1)}}toJulianDay(e){return e.yearGr?super.toJulianDay(e):Hr+ri(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.yearGr?super.getDaysInMonth(e):ni(e.year,e.month)}getDaysInYear(e){return e.yearGr?super.getDaysInYear(e):ii(e.year)}constructor(){if(super(),this.identifier=`islamic-umalqura`,$r||=new Uint16Array(Uint8Array.from(atob(Qr),e=>e.charCodeAt(0)).buffer),!ei){ei=new Uint32Array(Gr-Wr+1);let e=0;for(let t=Wr;t<=Gr;t++){ei[t-Wr]=e;for(let n=1;n<=12;n++)e+=ni(t,n)}}}};const oi=347997,si=1080,ci=24*si,li=29,ui=12*si+793,di=li*ci+ui;function fi(e){return Ut(e*7+1,19)<7}function pi(e){let t=Math.floor((235*e-234)/19),n=12084+13753*t,r=t*29+Math.floor(n/25920);return Ut(3*(r+1),7)<3&&(r+=1),r}function mi(e){let t=pi(e-1),n=pi(e),r=pi(e+1);return r-n===356?2:n-t===382?1:0}function hi(e){return pi(e)+mi(e)}function gi(e){return hi(e+1)-hi(e)}function _i(e){let t=gi(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function vi(e,t){if(t>=6&&!fi(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=_i(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?fi(e)?30:0:30}var yi=class{fromJulianDay(e){let t=e-oi,n=t*ci/di,r=Math.floor((19*n+234)/235)+1,i=hi(r),a=Math.floor(t-i);for(;a<1;)r--,i=hi(r),a=Math.floor(t-i);let o=1,s=0;for(;s6?e.month--:!fi(t.year)&&fi(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier=`hebrew`}};const bi=1723856,xi=1824665,Si=5500;function Ci(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function wi(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-Ci(e,n,1,1))/30),i=t+1-Ci(e,n,r,1);return[n,r,i]}function Ti(e){return Math.floor(e%4/3)}function Ei(e,t){return t%13==0?Ti(e)+5:30}var Di=class{fromJulianDay(e){let[t,n,r]=wi(bi,e),i=`AM`;return t<=0&&(i=`AA`,t+=Si),new hr(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`AA`&&(t-=Si),Ci(bi,t,e.month,e.day)}getDaysInMonth(e){return Ei(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+Ti(e.year)}getYearsInEra(e){return e.era===`AA`?9999:9991}getEras(){return[`AA`,`AM`]}constructor(){this.identifier=`ethiopic`}},Oi=class extends Di{fromJulianDay(e){let[t,n,r]=wi(bi,e);return t+=Si,new hr(this,`AA`,t,n,r)}getEras(){return[`AA`]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier=`ethioaa`}},ki=class extends Di{fromJulianDay(e){let[t,n,r]=wi(xi,e),i=`CE`;return t<=0&&(i=`BCE`,t=1-t),new hr(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`BCE`&&(t=1-t),Ci(xi,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return e.era===`BCE`&&(t=1-t),Ei(t,e.month)}isInverseEra(e){return e.era===`BCE`}balanceDate(e){e.year<=0&&(e.era=e.era===`BCE`?`CE`:`BCE`,e.year=1-e.year)}getEras(){return[`BCE`,`CE`]}getYearsInEra(e){return e.era===`BCE`?9999:9715}constructor(...e){super(...e),this.identifier=`coptic`}};function Ai(e){switch(e){case`buddhist`:return new kr;case`ethiopic`:return new Di;case`ethioaa`:return new Oi;case`coptic`:return new ki;case`hebrew`:return new yi;case`indian`:return new Vr;case`islamic-civil`:return new Xr;case`islamic-tbla`:return new Zr;case`islamic-umalqura`:return new ai;case`japanese`:return new Er;case`persian`:return new Rr;case`roc`:return new Pr;case`gregory`:default:return new Xt}}let ji=new Map;var Mi=class{format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange==`function`)return this.formatter.formatRange(e,t);if(t= start date`);return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts==`function`)return this.formatter.formatRangeToParts(e,t);if(t= start date`);let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return Ri()&&(this.resolvedHourCycle||=zi(e.locale,this.options),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle===`h11`||this.resolvedHourCycle===`h12`),e.calendar===`ethiopic-amete-alem`&&(e.calendar=`ethioaa`),e}constructor(e,t={}){this.formatter=Pi(e,t),this.options=t}};const Ni={true:{ja:`h11`},false:{}};function Pi(e,t={}){if(typeof t.hour12==`boolean`&&Ii()){t={...t};let n=Ni[String(t.hour12)][e.split(`-`)[0]],r=t.hour12?`h12`:`h23`;t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]e.type===`hour`).value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>e.type===`hour`).value,10);if(r===0&&i===23)return`h23`;if(r===24&&i===23)return`h24`;if(r===0&&i===11)return`h11`;if(r===12&&i===11)return`h12`;throw Error(`Unexpected hour cycle result`)}let Bi=new Map,Vi=!1;try{Vi=new Intl.NumberFormat(`de-DE`,{signDisplay:`exceptZero`}).resolvedOptions().signDisplay===`exceptZero`}catch{}let Hi=!1;try{Hi=new Intl.NumberFormat(`de-DE`,{style:`unit`,unit:`degree`}).resolvedOptions().style===`unit`}catch{}const Ui={degree:{narrow:{default:`°`,"ja-JP":` 度`,"zh-TW":`度`,"sl-SI":` °`}}};var Wi=class{format(e){let t=``;if(t=!Vi&&this.options.signDisplay!=null?Ki(this.numberFormatter,this.options.signDisplay,e):this.numberFormatter.format(e),this.options.style===`unit`&&!Hi){var n;let{unit:e,unitDisplay:r=`short`,locale:i}=this.resolvedOptions();if(!e)return t;let a=(n=Ui[e])?.[r];t+=a[i]||a.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange==`function`)return this.numberFormatter.formatRange(e,t);if(t= start date`);return`${this.format(e)} \u{2013} ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts==`function`)return this.numberFormatter.formatRangeToParts(e,t);if(t= start date`);let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!Vi&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!Hi&&this.options.style===`unit`&&(e={...e,style:`unit`,unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=Gi(e,t),this.options=t}};function Gi(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes(`-nu-`)&&(e.includes(`-u-`)||(e+=`-u-`),e+=`-nu-${n}`),t.style===`unit`&&!Hi){var r;let{unit:e,unitDisplay:n=`short`}=t;if(!e)throw Error(`unit option must be provided with style: "unit"`);if(!(r=Ui[e])?.[n])throw Error(`Unsupported unit ${e} with unitDisplay = ${n}`);t={...t,style:`decimal`}}let i=e+(t?Object.entries(t).sort((e,t)=>e[0]0||Object.is(n,0):t===`exceptZero`&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,``).replace(/\u200e|\u061C/,``);[...i].length!==1&&console.warn(`@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case`);let a=t.replace(r,`!!!`).replace(i,`+`).replace(`!!!`,r);return a}else return e.format(n)}}const qi=RegExp(`^.*\\(.*\\).*$`),Ji=[`latn`,`arab`,`hanidec`,`deva`,`beng`];var Yi=class{parse(e){return Zi(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,n){return Zi(this.locale,this.options,e).isValidPartialNumber(e,t,n)}getNumberingSystem(e){return Zi(this.locale,this.options,e).options.numberingSystem}constructor(e,t={}){this.locale=e,this.options=t}};const Xi=new Map;function Zi(e,t,n){let r=Qi(e,t);if(!e.includes(`-nu-`)&&!r.isValidPartialNumber(n)){for(let i of Ji)if(i!==r.options.numberingSystem){let r=Qi(e+(e.includes(`-u-`)?`-nu-`:`-u-nu-`)+i,t);if(r.isValidPartialNumber(n))return r}}return r}function Qi(e,t){let n=e+(t?Object.entries(t).sort((e,t)=>e[0]-1&&(t=`-${t}`)}let n=t?+t:NaN;if(isNaN(n))return NaN;if(this.options.style===`percent`){var r,i;let e={...this.options,style:`decimal`,minimumFractionDigits:Math.min(((r=this.options.minimumFractionDigits)??0)+2,20),maximumFractionDigits:Math.min(((i=this.options.maximumFractionDigits)??0)+2,20)};return new Yi(this.locale,e).parse(new Wi(this.locale,e).format(n))}return this.options.currencySign===`accounting`&&qi.test(e)&&(n=-1*n),n}sanitize(e){return e=e.replace(this.symbols.literals,``),this.symbols.minusSign&&(e=e.replace(`-`,this.symbols.minusSign)),this.options.numberingSystem===`arab`&&(this.symbols.decimal&&(e=e.replace(`,`,this.symbols.decimal),e=e.replace(`،`,this.symbols.decimal)),this.symbols.group&&(e=ra(e,`.`,this.symbols.group))),this.options.locale===`fr-FR`&&(e=ra(e,`.`,` `)),e}isValidPartialNumber(e,t=-1/0,n=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=ra(e,this.symbols.group,``)),e=e.replace(this.symbols.numeral,``),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,``)),e.length===0)}constructor(e,t={}){this.locale=e,this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=na(e,this.formatter,this.options,t);var n,r;this.options.style===`percent`&&(((n=this.options.minimumFractionDigits)??0)>18||((r=this.options.maximumFractionDigits)??0)>18)&&console.warn(`NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.`)}};const ea=new Set([`decimal`,`fraction`,`integer`,`minusSign`,`plusSign`,`group`]),ta=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function na(e,t,n,r){var i,a,o,s;let c=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:`auto`,roundingMode:`halfExpand`}),l=c.formatToParts(-10000.111),u=c.formatToParts(10000.111),d=ta.map(e=>c.formatToParts(e));var f;let p=(f=(i=l.find(e=>e.type===`minusSign`))?.value)??`-`,m=(a=u.find(e=>e.type===`plusSign`))?.value;!m&&(r?.signDisplay===`exceptZero`||r?.signDisplay===`always`)&&(m=`+`);let h=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001),g=(o=h.find(e=>e.type===`decimal`))?.value,_=(s=l.find(e=>e.type===`group`))?.value,v=l.filter(e=>!ea.has(e.type)).map(e=>ia(e.value)),y=d.flatMap(e=>e.filter(e=>!ea.has(e.type)).map(e=>ia(e.value))),b=[...new Set([...v,...y])].sort((e,t)=>t.length-e.length),x=b.length===0?RegExp(`[\\p{White_Space}]`,`gu`):RegExp(`${b.join(`|`)}|[\\p{White_Space}]`,`gu`),S=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),C=new Map(S.map((e,t)=>[e,t])),w=RegExp(`[${S.join(``)}]`,`g`),T=e=>String(C.get(e));return{minusSign:p,plusSign:m,decimal:g,group:_,literals:x,numeral:w,index:T}}function ra(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function ia(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function aa(e,t){let n=[];for(let r=0;r0}function pa(e,t){return e.compare(t)<=0}function ma(e,t){return e.compare(t)>=0}function ha(e,t,n){return ma(e,t)&&pa(e,n)}function ga(e,t,n){return fa(e,t)&&da(e,n)}function _a(e,t,n){let r=on(e,n);return t>r?e.subtract({days:r+7-t}):t===r?e:e.subtract({days:r-t})}function va(e,t,n){let r=on(e,n),i=t===0?6:t-1;return r===i?e:r>i?e.add({days:7-r+i}):e.add({days:i-r})}function ya(e,t,n,r){if(n===void 0&&r===void 0)return!0;let i=e.add({days:1});if(r!=null&&r(i)||n!=null&&n(i))return!1;let a=t;for(;i.compare(a)<0;)if(i=i.add({days:1}),r!=null&&r(i)||n!=null&&n(i))return!1;return!0}function ba(e,t){let n=[],r=e.add({days:1}),i=t;for(;r.compare(i)<0;)n.push(r),r=r.add({days:1});return n}function xa(e){let{dateObj:t,weekStartsOn:n,fixedWeeks:r,locale:i}=e,a=ua(t),o=Array.from({length:a},(e,n)=>t.set({day:n+1})),s=mn(t),c=hn(t),l=_a(s,n,i),u=va(c,n,i),d=ba(l.subtract({days:1}),s),f=ba(c,u.add({days:1})),p=d.length+o.length+f.length;if(r&&p<42){let e=42-p,n=f[f.length-1];n||=hn(t);let r=Array.from({length:e},(e,t)=>{let r=t+1;return n.add({days:r})});f.push(...r)}let m=d.concat(o,f),h=aa(m,7);return{value:t,cells:m,rows:h}}function Sa(e){let{numberOfMonths:t,dateObj:n,...r}=e,i=[];if(!t||t===1)return i.push(xa({...r,dateObj:n})),i;i.push(xa({...r,dateObj:n}));for(let e=1;e{let n=y(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},e=>(F(r,e),e)]}function Ca(e,t,n){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function wa(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function Ta(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function Ea(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=Ta(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return Number.isNaN(t)?!Number.isNaN(n)&&a>n&&(a=Math.floor(Ta(n/r,r))*r):an&&(a=t+Math.floor(Ta((n-t)/r,r))*r),a=Ta(a,r),a}function Da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Oa=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const ka=Da(Oa);function Aa(e,t){if(e.length!==t.length)return!1;for(let n=0;nka(e,t)),i=e.findIndex(e=>ka(e,n));if(r===-1||i===-1)return[];let[a,o]=[r,i].sort((e,t)=>e-t);return e.slice(a,o+1)}const Ma=typeof document<`u`;function Na(e){return e==null}function Pa(e){let{defaultValue:t,defaultPlaceholder:n,granularity:r=`day`,locale:i=`en`}=e;if(Array.isArray(t)&&t.length)return t.at(-1).copy();if(t&&!Array.isArray(t))return t.copy();if(n)return n.copy();let a=new Date,o=a.getFullYear(),s=a.getMonth()+1,c=a.getDate(),l=[`hour`,`minute`,`second`],u=new Mi(i),d=Ai(u.resolvedOptions().calendar);return l.includes(r??`day`)?Mn(new _r(o,s,c,0,0,0),d):Mn(new hr(o,s,c),d)}const Fa=`ach.af.am.an.ar.ast.az.be.bg.bn.br.bs.ca.cak.ckb.cs.cy.da.de.dsb.el.en.eo.es.et.eu.fa.ff.fi.fr.fy.ga.gd.gl.he.hr.hsb.hu.ia.id.it.ja.ka.kk.kn.ko.lb.lo.lt.lv.meh.ml.ms.nl.nn.no.oc.pl.pt.rm.ro.ru.sc.scn.sk.sl.sr.sv.szl.tg.th.tr.uk.zh-CN.zh-TW`.split(`.`),Ia=[`year`,`month`,`day`],La={ach:{year:`mwaka`,month:`dwe`,day:`nino`},af:{year:`jjjj`,month:`mm`,day:`dd`},am:{year:`ዓዓዓዓ`,month:`ሚሜ`,day:`ቀቀ`},an:{year:`aaaa`,month:`mm`,day:`dd`},ar:{year:`سنة`,month:`شهر`,day:`يوم`},ast:{year:`aaaa`,month:`mm`,day:`dd`},az:{year:`iiii`,month:`aa`,day:`gg`},be:{year:`гггг`,month:`мм`,day:`дд`},bg:{year:`гггг`,month:`мм`,day:`дд`},bn:{year:`yyyy`,month:`মিমি`,day:`dd`},br:{year:`bbbb`,month:`mm`,day:`dd`},bs:{year:`gggg`,month:`mm`,day:`dd`},ca:{year:`aaaa`,month:`mm`,day:`dd`},cak:{year:`jjjj`,month:`ii`,day:`q'q'`},ckb:{year:`ساڵ`,month:`مانگ`,day:`ڕۆژ`},cs:{year:`rrrr`,month:`mm`,day:`dd`},cy:{year:`bbbb`,month:`mm`,day:`dd`},da:{year:`åååå`,month:`mm`,day:`dd`},de:{year:`jjjj`,month:`mm`,day:`tt`},dsb:{year:`llll`,month:`mm`,day:`źź`},el:{year:`εεεε`,month:`μμ`,day:`ηη`},en:{year:`yyyy`,month:`mm`,day:`dd`},eo:{year:`jjjj`,month:`mm`,day:`tt`},es:{year:`aaaa`,month:`mm`,day:`dd`},et:{year:`aaaa`,month:`kk`,day:`pp`},eu:{year:`uuuu`,month:`hh`,day:`ee`},fa:{year:`سال`,month:`ماه`,day:`روز`},ff:{year:`hhhh`,month:`ll`,day:`ññ`},fi:{year:`vvvv`,month:`kk`,day:`pp`},fr:{year:`aaaa`,month:`mm`,day:`jj`},fy:{year:`jjjj`,month:`mm`,day:`dd`},ga:{year:`bbbb`,month:`mm`,day:`ll`},gd:{year:`bbbb`,month:`mm`,day:`ll`},gl:{year:`aaaa`,month:`mm`,day:`dd`},he:{year:`שנה`,month:`חודש`,day:`יום`},hr:{year:`gggg`,month:`mm`,day:`dd`},hsb:{year:`llll`,month:`mm`,day:`dd`},hu:{year:`éééé`,month:`hh`,day:`nn`},ia:{year:`aaaa`,month:`mm`,day:`dd`},id:{year:`tttt`,month:`bb`,day:`hh`},it:{year:`aaaa`,month:`mm`,day:`gg`},ja:{year:` 年 `,month:`月`,day:`日`},ka:{year:`წწწწ`,month:`თთ`,day:`რრ`},kk:{year:`жжжж`,month:`аа`,day:`кк`},kn:{year:`ವವವವ`,month:`ಮಿಮೀ`,day:`ದಿದಿ`},ko:{year:`연도`,month:`월`,day:`일`},lb:{year:`jjjj`,month:`mm`,day:`dd`},lo:{year:`ປປປປ`,month:`ດດ`,day:`ວວ`},lt:{year:`mmmm`,month:`mm`,day:`dd`},lv:{year:`gggg`,month:`mm`,day:`dd`},meh:{year:`aaaa`,month:`mm`,day:`dd`},ml:{year:`വർഷം`,month:`മാസം`,day:`തീയതി`},ms:{year:`tttt`,month:`mm`,day:`hh`},nl:{year:`jjjj`,month:`mm`,day:`dd`},nn:{year:`åååå`,month:`mm`,day:`dd`},no:{year:`åååå`,month:`mm`,day:`dd`},oc:{year:`aaaa`,month:`mm`,day:`jj`},pl:{year:`rrrr`,month:`mm`,day:`dd`},pt:{year:`aaaa`,month:`mm`,day:`dd`},rm:{year:`oooo`,month:`mm`,day:`dd`},ro:{year:`aaaa`,month:`ll`,day:`zz`},ru:{year:`гггг`,month:`мм`,day:`дд`},sc:{year:`aaaa`,month:`mm`,day:`dd`},scn:{year:`aaaa`,month:`mm`,day:`jj`},sk:{year:`rrrr`,month:`mm`,day:`dd`},sl:{year:`llll`,month:`mm`,day:`dd`},sr:{year:`гггг`,month:`мм`,day:`дд`},sv:{year:`åååå`,month:`mm`,day:`dd`},szl:{year:`rrrr`,month:`mm`,day:`dd`},tg:{year:`сссс`,month:`мм`,day:`рр`},th:{year:`ปปปป`,month:`ดด`,day:`วว`},tr:{year:`yyyy`,month:`aa`,day:`gg`},uk:{year:`рррр`,month:`мм`,day:`дд`},"zh-CN":{year:`年`,month:`月`,day:`日`},"zh-TW":{year:`年`,month:`月`,day:`日`}};function Ra(e){if(Ba(e))return La[e];{let t=Wa(e);return Ba(t)?La[t]:La.en}}function za(e,t,n){return Va(e)?Ra(n)[e]:Ua(e)?t:Ha(e)?`––`:``}function Ba(e){return Fa.includes(e)}function Va(e){return Ia.includes(e)}function Ha(e){return e===`hour`||e===`minute`||e===`second`}function Ua(e){return e===`era`||e===`dayPeriod`}function Wa(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}const Ga=[`day`,`month`,`year`],Ka=[`hour`,`minute`,`second`,`dayPeriod`],qa=[...Ga,...Ka];function Ja(e){return Ga.includes(e)}function Ya(e){return qa.includes(e)}function Xa(e,t){let n={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`short`,hourCycle:t===24?`h24`:void 0,hour12:t===24?!1:void 0};return e===`day`&&(delete n.second,delete n.hour,delete n.minute,delete n.timeZoneName),e===`hour`&&(delete n.minute,delete n.second),e===`minute`&&delete n.second,n}function Za(e){let t=e.querySelector(`[data-selected]`);if(t)return t.focus();let n=e.querySelector(`[data-today]`);if(n)return n.focus();let r=e.querySelector(`[data-radix-vue-calendar-day]`);if(r)return r.focus()}function Qa(e,t){var n;let r=ie();return H(()=>{r.value=e()},{...t,flush:(n=void 0,`sync`)}),ee(r)}function $a(e,t){let n,r,i,a=L(!0),o=()=>{a.value=!0,i()};V(e,o,{flush:`sync`});let s=typeof t==`function`?t:t.get,c=typeof t==`function`?void 0:t.set,l=f((e,t)=>(r=e,i=t,{get(){return a.value&&(n=s(),a.value=!1),r(),n},set(e){c?.(e)}}));return Object.isExtensible(l)&&(l.trigger=o),l}function eo(e){return g()?(j(e),!0):!1}function to(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return eo(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t)))}}function no(e){let t=!1,n,r=m(!0);return(...i)=>(t||(n=r.run(()=>e(...i)),t=!0),n)}function ro(e){let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return(...a)=>(t+=1,n||(r=m(!0),n=r.run(()=>e(...a))),eo(i),n)}function io(e){return typeof e==`function`?e():B(e)}function ao(e){if(!b(e))return I(e);let t=new Proxy({},{get(t,n,r){return B(Reflect.get(e.value,n,r))},set(t,n,r){return b(e.value[n])&&!b(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return I(t)}function oo(e){return ao(a(e))}const so=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;const co=e=>typeof e<`u`,lo=e=>e!=null,uo=Object.prototype.toString,fo=e=>uo.call(e)===`[object Object]`,po=()=>{},mo=ho();function ho(){var e,t;return so&&(e=window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(t=window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function go(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function _o(e,t={}){let n,r,i=po,a=e=>{clearTimeout(e),i(),i=po};return o=>{let s=io(e),c=io(t.maxWait);return n&&a(n),s<=0||c!==void 0&&c<=0?(r&&(a(r),r=null),Promise.resolve(o())):new Promise((e,l)=>{i=t.rejectOnCancel?l:e,c&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,e(o())},c)),n=setTimeout(()=>{r&&a(r),r=null,e(o())},s)})}}function vo(e){return h()}function yo(e,t=1e4){return f((n,r)=>{let i=io(e),a,o=()=>setTimeout(()=>{i=io(e),r()},io(t));return eo(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function bo(e,t=200,n={}){return go(_o(t,n),e)}function xo(e,t){vo()&&O(e,t)}function So(e,t=!0,n){vo()?A(e,n):t?e():w(e)}function Co(e,t,n={}){let{immediate:r=!0}=n,i=L(!1),a=null;function o(){a&&(clearTimeout(a),a=null)}function s(){i.value=!1,o()}function c(...n){o(),i.value=!0,a=setTimeout(()=>{i.value=!1,a=null,e(...n)},io(t))}return r&&(i.value=!0,so&&c()),eo(s),{isPending:ee(i),start:c,stop:s}}function wo(e=1e3,t={}){let{controls:n=!1,callback:r}=t,i=Co(r??po,e,t),o=a(()=>!i.isPending.value);return n?{ready:o,...i}:o}function To(e,t,n){let r=V(e,(...e)=>(w(()=>r()),t(...e)),n);return r}function Eo(e){var t;let n=io(e);return(t=n?.$el)??n}const Do=so?window:void 0;function Oo(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=Do):[t,n,r,i]=e,!t)return po;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=V(()=>[Eo(t),io(i)],([e,t])=>{if(o(),!e)return;let i=fo(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return eo(l),l}function ko(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ao(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=Do,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=ko(t);return Oo(i,a,e=>{e.repeat&&io(s)||c(e)&&n(e)},o)}function jo(){let e=L(!1),t=h();return t&&A(()=>{e.value=!0},t),e}function Mo(e){let t=jo();return a(()=>(t.value,!!e()))}function No(e,t,n={}){let{window:r=Do,...i}=n,o,s=Mo(()=>r&&`MutationObserver`in r),c=()=>{o&&(o.disconnect(),o=void 0)},l=a(()=>{let t=io(e),n=(Array.isArray(t)?t:[t]).map(Eo).filter(lo);return new Set(n)}),u=V(()=>l.value,e=>{c(),s.value&&e.size&&(o=new MutationObserver(t),e.forEach(e=>o.observe(e,i)))},{immediate:!0,flush:`post`}),d=()=>o?.takeRecords(),f=()=>{c(),u()};return eo(f),{isSupported:s,stop:f,takeRecords:d}}function Po(e={}){var t;let{window:n=Do,deep:r=!0,triggerOnRemoval:i=!1}=e,a=(t=e.document)??n?.document,o=()=>{var e;let t=a?.activeElement;if(r)for(;t!=null&&t.shadowRoot;)t=(e=t?.shadowRoot)?.activeElement;return t},s=L(),c=()=>{s.value=o()};return n&&(Oo(n,`blur`,e=>{e.relatedTarget===null&&c()},!0),Oo(n,`focus`,c,!0)),i&&No(a,e=>{e.filter(e=>e.removedNodes.length).map(e=>Array.from(e.removedNodes)).flat().forEach(e=>{e===s.value&&c()})},{childList:!0,subtree:!0}),c(),s}function Fo(e,t={}){let{immediate:n=!0,fpsLimit:r=void 0,window:i=Do}=t,a=L(!1),o=r?1e3/r:null,s=0,c=null;function l(t){if(!a.value||!i)return;s||=t;let n=t-s;if(o&&nnull,()=>t.proxy.$el);return N(n.trigger),A(n.trigger),n}function Ro(e,t,n={}){let{window:r=Do,...i}=n,o,s=Mo(()=>r&&`ResizeObserver`in r),c=()=>{o&&(o.disconnect(),o=void 0)},l=a(()=>Array.isArray(e)?e.map(e=>Eo(e)):[Eo(e)]),u=V(l,e=>{if(c(),s.value&&r){o=new ResizeObserver(t);for(let t of e)t&&o.observe(t,i)}},{immediate:!0,flush:`post`}),d=()=>{c(),u()};return eo(d),{isSupported:s,stop:d}}function zo(e,t={}){let n=Po(t),r=a(()=>Eo(e));return{focused:a(()=>r.value&&n.value?r.value.contains(n.value):!1)}}function Bo(e=Lo()){let t=ie(),n=()=>{let n=Eo(e);n&&(t.value=n.parentElement)};return So(n),V(()=>io(e),n),t}function q(e,t,n,r={}){var i,o,s;let{clone:c=!1,passive:l=!1,eventName:u,deep:d=!1,defaultValue:f,shouldEmit:p}=r,m=h(),g=n||m?.emit||(i=m?.$emit)?.bind(m)||(s=(o=m?.proxy)?.$emit)?.bind(m?.proxy),_=u;t||=`modelValue`,_||=`update:${t.toString()}`;let v=e=>c?typeof c==`function`?c(e):Io(e):e,y=()=>co(e[t])?v(e[t]):f,b=e=>{p?p(e)&&g(_,e):g(_,e)};if(l){let n=y(),r=L(n),i=!1;return V(()=>e[t],e=>{i||(i=!0,r.value=v(e),w(()=>i=!1))}),V(r,n=>{!i&&(n!==e[t]||d)&&b(n)},{deep:d}),r}else return a({get(){return y()},set(e){b(e)}})}function Vo(e){return e?e.flatMap(e=>e.type===t?Vo(e.children):[e]):[]}function J(){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}const Ho=[`INPUT`,`TEXTAREA`];function Uo(e,t,n,r={}){if(!t||r.enableIgnoredElement&&Ho.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-radix-vue-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=Wo(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function Wo(e,t,n,r=e.length){if(--r===0)return null;let i=e.indexOf(t),a=n.goForward?i+1:i-1;if(!n.loop&&(a<0||a>=e.length))return null;let o=(a+e.length)%e.length,s=e[o];return s?s.hasAttribute(`disabled`)&&s.getAttribute(`disabled`)!==`false`?Wo(e,s,n,r):s:null}function Go(e){if(typeof e!=`object`||!e)return!1;let 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 Ko(e,t,n=`.`,r){if(!Go(t))return Ko(e,{},n,r);let i=Object.assign({},t);for(let t in e){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:Go(a)&&Go(i[t])?i[t]=Ko(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function qo(e){return(...t)=>t.reduce((t,n)=>Ko(t,n,``,e),{})}const Jo=qo(),[Yo,Xo]=K(`ConfigProvider`),Zo=p({inheritAttrs:!1,__name:`ConfigProvider`,props:{dir:{default:`ltr`},scrollBody:{type:[Boolean,Object],default:!0},nonce:{default:void 0},useId:{type:Function,default:void 0}},setup(e){let t=e,{dir:n,scrollBody:r,nonce:i}=z(t);return Xo({dir:n,scrollBody:r,nonce:i,useId:t.useId}),(e,t)=>R(e.$slots,`default`)}});let Qo=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,$o=(e=21)=>{let t=``,n=e;for(;n--;)t+=Qo[Math.random()*64|0];return t};const es=ro(()=>{let e=L(new Map),t=L(),n=a(()=>{for(let t of e.value.values())if(t)return!0;return!1}),r=Yo({scrollBody:L(!0)}),i=null,o=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,document.body.style.pointerEvents=``,document.body.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=t.value??``,mo&&i?.(),t.value=void 0};return V(n,(e,n)=>{var a;if(!so)return;if(!e){n&&o();return}t.value===void 0&&(t.value=document.body.style.overflow);let s=window.innerWidth-document.documentElement.clientWidth,c={padding:s,margin:0},l=(a=r.scrollBody)!=null&&a.value?typeof r.scrollBody.value==`object`?Jo({padding:r.scrollBody.value.padding===!0?s:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?s:r.scrollBody.value.margin},c):c:{padding:0,margin:0};s>0&&(document.body.style.paddingRight=typeof l.padding==`number`?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin==`number`?`${l.margin}px`:String(l.margin),document.body.style.setProperty(`--scrollbar-width`,`${s}px`),document.body.style.overflow=`hidden`),mo&&(i=Oo(document,`touchmove`,e=>rs(e),{passive:!1})),w(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})},{immediate:!0,flush:`sync`}),e});function ts(e){let t=$o(6),n=es();n.value.set(t,e??!1);let r=a({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return xo(()=>{n.value.delete(t)}),r}function ns(e){let t=window.getComputedStyle(e);if(t.overflowX===`scroll`||t.overflowY===`scroll`||t.overflowX===`auto`&&e.clientWidth1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}const os=`data-radix-vue-collection-item`;function ss(e,t=os){let n=e??Symbol();return{createCollection:e=>{let r=L([]);function i(){let n=Eo(e);return n?r.value=Array.from(n.querySelectorAll(`[${t}]:not([data-disabled])`)):r.value=[]}return k(()=>{r.value=[]}),A(i),N(i),V(()=>e?.value,i,{immediate:!0}),F(n,r),r},injectCollection:()=>y(n,L([]))}}function cs(e){let t=L(e);function n(){return t.value}function r(e){t.value=e}function i(e,n){return new Mi(t.value,n).format(e)}function a(e,t=!0){return la(e)&&t?i(oa(e),{dateStyle:`long`,timeStyle:`long`}):i(oa(e),{dateStyle:`long`})}function o(e,n={}){return new Mi(t.value,{month:`long`,year:`numeric`,...n}).format(e)}function s(e,n={}){return new Mi(t.value,{month:`long`,...n}).format(e)}function c(){let e=cn(pn());return[1,2,3,4,5,6,7,8,9,10,11,12].map(t=>({label:s(oa(e.set({month:t}))),value:t}))}function l(e,n={}){return new Mi(t.value,{year:`numeric`,...n}).format(e)}function u(e,n){return ca(e)?new Mi(t.value,{...n,timeZone:e.timeZone}).formatToParts(oa(e)):new Mi(t.value,n).formatToParts(oa(e))}function d(e,n=`narrow`){return new Mi(t.value,{weekday:n}).format(e)}function f(e){var n;return(n=new Mi(t.value,{hour:`numeric`,minute:`numeric`}).formatToParts(e).find(e=>e.type===`dayPeriod`))?.value===`PM`?`PM`:`AM`}let p={year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`};function m(e,t,n={}){let r={...p,...n},i=u(e,r).find(e=>e.type===t);return i?i.value:``}return{setLocale:r,getLocale:n,fullMonth:s,fullYear:l,fullMonthAndYear:o,toParts:u,custom:i,part:m,dayPeriod:f,selectedDate:a,dayOfWeek:d,getMonths:c}}function Y(e){let t=Yo({dir:L(`ltr`)});return a(()=>{var n;return e?.value||(n=t.dir)?.value||`ltr`})}function ls(e){let t=h(),n=t?.type.emits,i={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(t=>{i[oe(r(t))]=(...n)=>e(t,...n)}),i}let us=0;function ds(){H(e=>{if(!so)return;let t=document.querySelectorAll(`[data-radix-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??fs()),document.body.insertAdjacentElement(`beforeend`,t[1]??fs()),us++,e(()=>{us===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),us--})})}function fs(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function ps(e){return a(()=>{var t;return io(e)?!!((t=Eo(e))!=null&&t.closest(`form`)):!0})}function ms(e){let t=h(),n=Object.keys(t?.type.props??{}).reduce((e,n)=>{let r=(t?.type.props[n]).default;return r!==void 0&&(e[n]=r),e},{}),i=le(e);return a(()=>{let e={},a=t?.vnode.props??{};return Object.keys(a).forEach(t=>{e[r(t)]=a[t]}),Object.keys({...n,...e}).reduce((e,t)=>(i.value[t]!==void 0&&(e[t]=i.value[t]),e),{})})}function hs(e,t){let n=ms(e),r=t?ls(t):{};return a(()=>({...n.value,...r}))}function X(){let e=h(),t=L(),n=a(()=>{var e,n;return[`#text`,`#comment`].includes((e=t.value)?.$el.nodeName)?(n=t.value)?.$el.nextElementSibling:Eo(t)}),r=Object.assign({},e.exposed),i={};for(let t in e.props)Object.defineProperty(i,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(r).length>0)for(let e in r)Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>r[e]});Object.defineProperty(i,`$el`,{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function o(n){t.value=n,n&&(Object.defineProperty(i,`$el`,{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),e.exposed=i)}return{forwardRef:o,currentRef:t,currentElement:n}}function gs(e,t){let n=yo(!1,300),r=L(null),i=to();function a(){r.value=null,n.value=!1}function o(e,t){let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=_s(a,i.getBoundingClientRect()),s=vs(a,o),c=ys(t.getBoundingClientRect()),l=xs([...s,...c]);r.value=l,n.value=!0}return H(n=>{if(e.value&&t.value){let r=e=>o(e,t.value),i=t=>o(t,e.value);e.value.addEventListener(`pointerleave`,r),t.value.addEventListener(`pointerleave`,i),n(()=>{var n,a;(n=e.value)==null||n.removeEventListener(`pointerleave`,r),(a=t.value)==null||a.removeEventListener(`pointerleave`,i)})}}),H(n=>{var o;if(r.value){let s=n=>{var o,s;if(!r.value)return;let c=n.target,l={x:n.clientX,y:n.clientY},u=(o=e.value)?.contains(c)||(s=t.value)?.contains(c),d=!bs(l,r.value),f=!!c.closest(`[data-grace-area-trigger]`);u?a():(d||f)&&(a(),i.trigger())};(o=e.value)==null||o.ownerDocument.addEventListener(`pointermove`,s),n(()=>{var t;return(t=e.value)?.ownerDocument.removeEventListener(`pointermove`,s)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function _s(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function vs(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ys(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function bs(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function xs(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y?1:0),Ss(t)}function Ss(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Cs=function(e){if(typeof document>`u`)return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ws=new WeakMap,Ts=new WeakMap,Es={},Ds=0,Os=function(e){return e&&(e.host||Os(e.parentNode))},ks=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Os(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},As=function(e,t,n,r){var i=ks(t,Array.isArray(e)?e:[e]);Es[n]||(Es[n]=new WeakMap);var a=Es[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(ws.get(e)||0)+1,l=(a.get(e)||0)+1;ws.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ts.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ds++,function(){o.forEach(function(e){var t=ws.get(e)-1,i=a.get(e)-1;ws.set(e,t),a.set(e,i),t||(Ts.has(e)||e.removeAttribute(r),Ts.delete(e)),i||e.removeAttribute(n)}),Ds--,Ds||(ws=new WeakMap,ws=new WeakMap,Ts=new WeakMap,Es={})}},js=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=Cs(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live]`))),As(r,i,n,`aria-hidden`)):function(){return null}};function Ms(e){let t;V(()=>Eo(e),e=>{e?t=js(e):t&&t()}),M(()=>{t&&t()})}let Ns=0;function Z(e,t=`radix`){if(e)return e;let n=Yo({useId:void 0});return de?`${t}-${de()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++Ns}`}function Ps(e,t){let n=L(),r=(r,i)=>{if(t.multiple&&Array.isArray(e.value))if(t.selectionBehavior===`replace`)e.value=[r],n.value=r;else{let t=e.value.findIndex(e=>i(e));t===-1?e.value.push(r):e.value.splice(t,1)}else t.selectionBehavior===`replace`?e.value={...r}:!Array.isArray(e.value)&&i(e.value)?e.value=void 0:e.value={...r};return e.value};function i(r,i,a,o){var s;if(!(n!=null&&n.value)||!t.multiple||!Array.isArray(e.value))return;let c=(s=a().filter(e=>e.ref.dataset.disabled!==``).find(e=>e.ref===i))?.value;if(!c)return;let l=null;switch(r){case`prev`:case`next`:l=ja(o,n.value,c);break;case`first`:l=ja(o,n.value,o?.[0]);break;case`last`:l=ja(o,n.value,o?.[o.length-1]);break}e.value=l}return{firstValue:n,onSelectItem:r,handleMultipleReplace:i}}function Fs(e){let t=L(),n=a(()=>{var e;return(e=t.value)?.width??0}),r=a(()=>{var e;return(e=t.value)?.height??0});return A(()=>{let n=Eo(e);if(n){t.value={width:n.offsetWidth,height:n.offsetHeight};let e=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let r=e[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=n.offsetWidth,a=n.offsetHeight;t.value={width:i,height:a}});return e.observe(n,{box:`border-box`}),()=>e.unobserve(n)}else t.value=void 0}),{width:n,height:r}}function Is(e,t){let n=L(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}const Ls=`data-item-text`;function Rs(e){let t=yo(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(!(e!=null&&e.value)&&!r)return;t.value+=n;let i=e?.value??r,a=J(),o=i.map(e=>{var t;return{ref:e,textValue:(t=(e.querySelector(`[${Ls}]`)??e).textContent)?.trim()??``}}),s=o.find(e=>e.ref===a),c=o.map(e=>e.textValue),l=Bs(c,t.value,s?.textValue),u=o.find(e=>e.textValue===l);return u&&u.ref.focus(),u?.ref},resetTypeahead:()=>{t.value=``}}}function zs(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Bs(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zs(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Vs(){return{ALT:`Alt`,ARROW_DOWN:`ArrowDown`,ARROW_LEFT:`ArrowLeft`,ARROW_RIGHT:`ArrowRight`,ARROW_UP:`ArrowUp`,BACKSPACE:`Backspace`,CAPS_LOCK:`CapsLock`,CONTROL:`Control`,DELETE:`Delete`,END:`End`,ENTER:`Enter`,ESCAPE:`Escape`,F1:`F1`,F10:`F10`,F11:`F11`,F12:`F12`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,HOME:`Home`,META:`Meta`,PAGE_DOWN:`PageDown`,PAGE_UP:`PageUp`,SHIFT:`Shift`,SPACE:` `,TAB:`Tab`,CTRL:`Control`,ASTERISK:`*`,SPACE_CODE:`Space`}}const Hs=p({name:`PrimitiveSlot`,inheritAttrs:!1,setup(t,{attrs:n,slots:r}){return()=>{var t,a;if(!r.default)return null;let o=Vo(r.default()),s=o.findIndex(t=>t.type!==e);if(s===-1)return o;let c=o[s];(t=c.props)==null||delete t.ref;let l=c.props?C(n,c.props):n;n.class&&(a=c.props)!=null&&a.class&&delete c.props.class;let u=i(c,l);for(let e in l)e.startsWith(`on`)&&(u.props||={},u.props[e]=l[e]);return o.length===1?u:(o[s]=u,o)}}}),Q=p({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&[`area`,`img`,`input`].includes(r)?()=>v(r,t):r===`template`?()=>v(Hs,t,{default:n.default}):()=>v(e.as,t,{default:n.default})}});function Us(){let e=L(),t=a(()=>{var t,n;return[`#text`,`#comment`].includes((t=e.value)?.$el.nodeName)?(n=e.value)?.$el.nextElementSibling:Eo(e)});return{primitiveElement:e,currentElement:t}}const[Ws,Gs]=K(`CollapsibleRoot`),Ks=p({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=q(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),a=q(r,`disabled`);return Gs({contentId:``,disabled:a,open:i,onOpenToggle:()=>{i.value=!i.value}}),t({open:i}),X(),(e,t)=>(P(),s(B(Q),{as:e.as,"as-child":r.asChild,"data-state":B(i)?`open`:`closed`,"data-disabled":B(a)?``:void 0},{default:U(()=>[R(e.$slots,`default`,{open:B(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),qs=p({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=Ws();return(e,r)=>{var i,a;return P(),s(B(Q),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":B(n).contentId,"aria-expanded":B(n).open.value,"data-state":B(n).open.value?`open`:`closed`,"data-disabled":(i=B(n).disabled)!=null&&i.value?``:void 0,disabled:(a=B(n).disabled)?.value,onClick:B(n).onOpenToggle},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`])}}});function Js(e,t){var n;let r=L({}),i=L(`none`),o=L(e),s=e.value?`mounted`:`unmounted`,c,l=(n=t.value)?.ownerDocument.defaultView??Do,{state:u,dispatch:d}=Is(s,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),f=e=>{var n;if(so){let r=new CustomEvent(e,{bubbles:!1,cancelable:!1});(n=t.value)==null||n.dispatchEvent(r)}};V(e,async(e,n)=>{var a;let o=n!==e;if(await w(),o){let o=i.value,s=Ys(t.value);e?(d(`MOUNT`),f(`enter`),s===`none`&&f(`after-enter`)):s===`none`||(a=r.value)?.display===`none`?(d(`UNMOUNT`),f(`leave`),f(`after-leave`)):n&&o!==s?(d(`ANIMATION_OUT`),f(`leave`)):(d(`UNMOUNT`),f(`after-leave`))}},{immediate:!0});let p=e=>{let n=Ys(t.value),r=n.includes(e.animationName),i=u.value===`mounted`?`enter`:`leave`;if(e.target===t.value&&r&&(f(`after-${i}`),d(`ANIMATION_END`),!o.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,c=l?.setTimeout(()=>{var n;(n=t.value)?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}e.target===t.value&&n===`none`&&d(`ANIMATION_END`)},m=e=>{e.target===t.value&&(i.value=Ys(t.value))},h=V(t,(e,t)=>{e?(r.value=getComputedStyle(e),e.addEventListener(`animationstart`,m),e.addEventListener(`animationcancel`,p),e.addEventListener(`animationend`,p)):(d(`ANIMATION_END`),c!==void 0&&l?.clearTimeout(c),t?.removeEventListener(`animationstart`,m),t?.removeEventListener(`animationcancel`,p),t?.removeEventListener(`animationend`,p))},{immediate:!0}),g=V(u,()=>{let e=Ys(t.value);i.value=u.value===`mounted`?e:`none`});return M(()=>{h(),g()}),{isPresent:a(()=>[`mounted`,`unmountSuspended`].includes(u.value))}}function Ys(e){return e&&getComputedStyle(e).animationName||`none`}const Xs=p({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var r;let{present:i,forceMount:a}=z(e),o=L(),{isPresent:s}=Js(i,o);n({present:s});let c=t.default({present:s});c=Vo(c||[]);let l=h();if(c&&c?.length>1){let e=(r=l?.parent)!=null&&r.type.name?`<${l.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` 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(e=>` - ${e}`).join(` `)].join(` `))}return()=>a.value||i.value||s.value?v(t.default({present:s})[0],{ref:e=>{let t=Eo(e);return typeof t?.hasAttribute>`u`||(t!=null&&t.hasAttribute(`data-radix-popper-content-wrapper`)?o.value=t.firstElementChild:o.value=t),t}}):null}}),Zs=p({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=Ws();n.contentId||=Z(void 0,`radix-vue-collapsible-content`);let r=L(),{forwardRef:i,currentElement:o}=X(),l=L(0),u=L(0),f=a(()=>n.open.value),p=L(f.value),m=L();return V(()=>{var e;return[f.value,(e=r.value)?.present]},async()=>{await w();let e=o.value;if(!e)return;m.value=m.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();u.value=t.height,l.value=t.width,p.value||(e.style.transitionDuration=m.value.transitionDuration,e.style.animationName=m.value.animationName)},{immediate:!0}),A(()=>{requestAnimationFrame(()=>{p.value=!1})}),(e,a)=>(P(),s(B(Xs),{ref_key:`presentRef`,ref:r,present:e.forceMount||B(n).open.value,"force-mount":!0},{default:U(()=>{var a,o;return[d(B(Q),C(e.$attrs,{id:B(n).contentId,ref:B(i),"as-child":t.asChild,as:e.as,"data-state":B(n).open.value?`open`:`closed`,"data-disabled":(a=B(n).disabled)!=null&&a.value?``:void 0,hidden:!((o=r.value)!=null&&o.present),style:{"--radix-collapsible-content-height":`${u.value}px`,"--radix-collapsible-content-width":`${l.value}px`}}),{default:U(()=>{var t;return[(t=r.value)!=null&&t.present?R(e.$slots,`default`,{key:0}):c(``,!0)]}),_:3},16,[`id`,`as-child`,`as`,`data-state`,`data-disabled`,`hidden`,`style`])]}),_:3},8,[`present`]))}});function Qs({type:e,defaultValue:t,modelValue:n}){let r=n||t;if(Na(e)&&Na(n)&&Na(t))throw Error("Either the `type` or the `value` or `default-value` prop must be defined.");if(n!==void 0&&t!==void 0&&typeof n!=typeof t)throw Error(`Invalid prop \`value\` of value \`${n}\` supplied, should be the same type as the \`defaultValue\` prop, which is \`${t}\`. The \`value\` prop must be: ${e===`single`?`- a string`:e===`multiple`?`- an array of strings`:`- a string diff --git a/assets/effect-WSjEuzC9-C7hO9AAX.js b/assets/effect-WSjEuzC9-BizqJV0H.js similarity index 55% rename from assets/effect-WSjEuzC9-C7hO9AAX.js rename to assets/effect-WSjEuzC9-BizqJV0H.js index 8b071dc09de3c91f9f8906c1f54c0a8da8b60e8d..d69ba4c6a7a6771350528209719aee7ddf3bd98f 100644 --- a/assets/effect-WSjEuzC9-C7hO9AAX.js +++ b/assets/effect-WSjEuzC9-BizqJV0H.js @@ -1 +1 @@ -import{__vitePreload as e}from"./index-BSwg6FIo.js";import{tryImport as t}from"./index-CISmcbXk-D9DoS9jO.js";const n=async()=>{let{JSONSchema:n}=await t(e(()=>import(`./__vite-optional-peer-dep_effect_xsschema-CSjxbBMs.js`),[]),`effect`);return e=>n.make(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{__vitePreload as e}from"./index-DKziOBM4.js";import{tryImport as t}from"./index-CISmcbXk-DB1OKNbQ.js";const n=async()=>{let{JSONSchema:n}=await t(e(()=>import(`./__vite-optional-peer-dep_effect_xsschema-CSjxbBMs.js`),[]),`effect`);return e=>n.make(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/elevenlabs-3r9LKRu7.js b/assets/elevenlabs-DrNId1mR.js similarity index 88% rename from assets/elevenlabs-3r9LKRu7.js rename to assets/elevenlabs-DrNId1mR.js index b30713c5b98dac898a8e09d1b97a4d3928b42da3..151e927d2df8f3a391ef21d91dd6281d567e7d73 100644 --- a/assets/elevenlabs-3r9LKRu7.js +++ b/assets/elevenlabs-DrNId1mR.js @@ -1 +1 @@ -import{computed as e,createBaseVNode as t,createBlock as n,createVNode as r,defineComponent as i,onMounted as a,openBlock as o,ref as s,storeToRefs as c,unref as l,useI18n as u,watch as d,withCtx as f}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import{FieldCheckbox_default as h,FieldRange_default as g}from"./src-CX9nVT7I.js";import{SpeechPlayground_default as _,SpeechProviderSettings_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`;var C=i({__name:`elevenlabs`,setup(i){let y={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},C=s(0),w=s(1),T=s(0),E=s(0),D=s(.5),O=s(.75),k=s(!1),A=m(),j=p(),{providers:M}=c(j),{t:N}=u(),P=e(()=>{var e;return!!(e=M.value[x])?.apiKey}),F=e(()=>A.availableVoices[x]||[]);async function I(e,t,n){let r=j.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=j.getProviderConfig(x),a=i.model||S;return await A.speech(r,a,e,t,{...i,...y})}return a(async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),d(C,async()=>{let e=j.getProviderConfig(x);e.pitch=C.value}),d(w,async()=>{let e=j.getProviderConfig(x);e.speed=w.value}),d(T,async()=>{let e=j.getProviderConfig(x);e.volume=T.value}),d(E,async()=>{let e=j.getProviderConfig(x);e.style=E.value}),d(D,async()=>{let e=j.getProviderConfig(x);e.stability=D.value}),d(O,async()=>{let e=j.getProviderConfig(x);e.similarityBoost=O.value}),d(k,async()=>{let e=j.getProviderConfig(x);e.useSpeakerBoost=k.value}),d(M,async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,i)=>(o(),n(l(v),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":f(()=>[t(`div`,b,[r(l(g),{modelValue:C.value,"onUpdate:modelValue":i[0]||=e=>C.value=e,label:l(N)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:l(N)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),r(l(g),{modelValue:w.value,"onUpdate:modelValue":i[1]||=e=>w.value=e,label:l(N)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(N)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(g),{modelValue:T.value,"onUpdate:modelValue":i[2]||=e=>T.value=e,label:l(N)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:l(N)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),r(l(g),{modelValue:E.value,"onUpdate:modelValue":i[3]||=e=>E.value=e,label:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.label`),description:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(g),{modelValue:D.value,"onUpdate:modelValue":i[4]||=e=>D.value=e,label:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.label`),description:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(g),{modelValue:O.value,"onUpdate:modelValue":i[5]||=e=>O.value=e,label:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label`),description:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(h),{modelValue:k.value,"onUpdate:modelValue":i[6]||=e=>k.value=e,label:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label`),description:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description`)},null,8,[`modelValue`,`label`,`description`])])]),playground:f(()=>[r(l(_),{"available-voices":F.value,"generate-speech":I,"api-key-configured":P.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file +import{computed as e,createBaseVNode as t,createBlock as n,createVNode as r,defineComponent as i,onMounted as a,openBlock as o,ref as s,storeToRefs as c,unref as l,useI18n as u,watch as d,withCtx as f}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import{FieldCheckbox_default as h,FieldRange_default as g}from"./src-CmPNYgc5.js";import{SpeechPlayground_default as _,SpeechProviderSettings_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`;var C=i({__name:`elevenlabs`,setup(i){let y={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},C=s(0),w=s(1),T=s(0),E=s(0),D=s(.5),O=s(.75),k=s(!1),A=m(),j=p(),{providers:M}=c(j),{t:N}=u(),P=e(()=>{var e;return!!(e=M.value[x])?.apiKey}),F=e(()=>A.availableVoices[x]||[]);async function I(e,t,n){let r=j.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=j.getProviderConfig(x),a=i.model||S;return await A.speech(r,a,e,t,{...i,...y})}return a(async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),d(C,async()=>{let e=j.getProviderConfig(x);e.pitch=C.value}),d(w,async()=>{let e=j.getProviderConfig(x);e.speed=w.value}),d(T,async()=>{let e=j.getProviderConfig(x);e.volume=T.value}),d(E,async()=>{let e=j.getProviderConfig(x);e.style=E.value}),d(D,async()=>{let e=j.getProviderConfig(x);e.stability=D.value}),d(O,async()=>{let e=j.getProviderConfig(x);e.similarityBoost=O.value}),d(k,async()=>{let e=j.getProviderConfig(x);e.useSpeakerBoost=k.value}),d(M,async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,i)=>(o(),n(l(v),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":f(()=>[t(`div`,b,[r(l(g),{modelValue:C.value,"onUpdate:modelValue":i[0]||=e=>C.value=e,label:l(N)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:l(N)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),r(l(g),{modelValue:w.value,"onUpdate:modelValue":i[1]||=e=>w.value=e,label:l(N)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(N)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(g),{modelValue:T.value,"onUpdate:modelValue":i[2]||=e=>T.value=e,label:l(N)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:l(N)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),r(l(g),{modelValue:E.value,"onUpdate:modelValue":i[3]||=e=>E.value=e,label:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.label`),description:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(g),{modelValue:D.value,"onUpdate:modelValue":i[4]||=e=>D.value=e,label:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.label`),description:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(g),{modelValue:O.value,"onUpdate:modelValue":i[5]||=e=>O.value=e,label:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label`),description:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(h),{modelValue:k.value,"onUpdate:modelValue":i[6]||=e=>k.value=e,label:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label`),description:l(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description`)},null,8,[`modelValue`,`label`,`description`])])]),playground:f(()=>[r(l(_),{"available-voices":F.value,"generate-speech":I,"api-key-configured":P.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/emotions-SSc0a-LV.js b/assets/emotions-EE6Y-cSt.js similarity index 81% rename from assets/emotions-SSc0a-LV.js rename to assets/emotions-EE6Y-cSt.js index 187606dfee5bb441b32016428fe9f80449dfef5f..1a5b242c75cf5d76c8c4af6a84873b7964781d6e 100644 --- a/assets/emotions-SSc0a-LV.js +++ b/assets/emotions-EE6Y-cSt.js @@ -1 +1 @@ -import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,ref as o,renderList as s,toDisplayString as c,unref as l}from"./index-BSwg6FIo.js";import"./src-CX9nVT7I.js";import"./Basic-BGRWPjtG.js";import{Textarea_default as u}from"./Textarea-CuugR8VV.js";import{useQueue as d}from"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import{llmInferenceEndToken as f,useEmotionsMessageQueue as p}from"./queues-XZuprNy-.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},y={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var b=i({__name:`emotions`,setup(i){let b=o(``),x=o([]),S=o([]),C=o(!1),w=d({handlers:[async e=>{S.value.push(e.data)}]}),T=p(w);function E(){C.value=!0;let e=b.value.split(``);for(let t of e)T.add(t);T.add(f),b.value=``,C.value=!1}return(i,o)=>(a(),n(`div`,m,[t(`div`,h,[r(l(u),{modelValue:b.value,"onUpdate:modelValue":o[0]||=e=>b.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:E},null,8,[`modelValue`]),t(`button`,g,c(C.value?`Processing...`:`Send`),1)]),t(`div`,_,[t(`div`,v,[o[1]||=t(`h3`,{"font-semibold":``},` Messages `,-1),(a(!0),n(e,null,s(x.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e),1)]))),128))]),t(`div`,y,[o[2]||=t(`h3`,{"font-semibold":``},` Emotions `,-1),(a(!0),n(e,null,s(S.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e),1)]))),128))])])]))}}),x=b;export{x as default}; \ No newline at end of file +import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,ref as o,renderList as s,toDisplayString as c,unref as l}from"./index-DKziOBM4.js";import"./src-CmPNYgc5.js";import"./Basic-C8g-kAol.js";import{Textarea_default as u}from"./Textarea-BIh0Stpi.js";import"./sleep-JdatAils.js";import{useQueue as d}from"./queue-D6mkPVC_.js";import{llmInferenceEndToken as f,useEmotionsMessageQueue as p}from"./queues-BZSFjE0u.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},y={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var b=i({__name:`emotions`,setup(i){let b=o(``),x=o([]),S=o([]),C=o(!1),w=d({handlers:[async e=>{S.value.push(e.data)}]}),T=p(w);function E(){C.value=!0;let e=b.value.split(``);for(let t of e)T.add(t);T.add(f),b.value=``,C.value=!1}return(i,o)=>(a(),n(`div`,m,[t(`div`,h,[r(l(u),{modelValue:b.value,"onUpdate:modelValue":o[0]||=e=>b.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:E},null,8,[`modelValue`]),t(`button`,g,c(C.value?`Processing...`:`Send`),1)]),t(`div`,_,[t(`div`,v,[o[1]||=t(`h3`,{"font-semibold":``},` Messages `,-1),(a(!0),n(e,null,s(x.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e),1)]))),128))]),t(`div`,y,[o[2]||=t(`h3`,{"font-semibold":``},` Emotions `,-1),(a(!0),n(e,null,s(S.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e),1)]))),128))])])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/featherless-ai-jAdyMyy3.js b/assets/featherless-ai-Ca5fPlYY.js similarity index 82% rename from assets/featherless-ai-jAdyMyy3.js rename to assets/featherless-ai-Ca5fPlYY.js index 5a6973e937f1d83ae0de1709b870500e7137f005..866f97bfe59800621b0131e9167936884d98345a 100644 --- a/assets/featherless-ai-jAdyMyy3.js +++ b/assets/featherless-ai-Ca5fPlYY.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`featherless-ai`;var x=r({__name:`featherless-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.featherless.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`featherless-ai`;var x=r({__name:`featherless-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.featherless.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/filter-message-C1Dba7ss.js b/assets/filter-message-ByGUaxmz.js similarity index 82% rename from assets/filter-message-C1Dba7ss.js rename to assets/filter-message-ByGUaxmz.js index 430efc9c48de875d490ac60c738279af9e95600c..7163cee1d80abe3cce2c3a6635b47d487ad20f49 100644 --- a/assets/filter-message-C1Dba7ss.js +++ b/assets/filter-message-ByGUaxmz.js @@ -1 +1 @@ -import{createBaseVNode as e,createElementBlock as t,createVNode as n,defineComponent as r,openBlock as i,ref as a,toDisplayString as o,unref as s}from"./index-BSwg6FIo.js";import"./src-CX9nVT7I.js";import"./Basic-BGRWPjtG.js";import{Textarea_default as c}from"./Textarea-CuugR8VV.js";import{sleep as l}from"./sleep-CvjNLutj.js";const u={flex:``,"flex-col":``,"gap-2":``,"p-2":``},d={flex:``,"flex-row":``,"gap-2":``},f={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},p={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var m=r({__name:`filter-message`,setup(r){let m=a(``),h=a(!1),g=a({content:``});async function _(){h.value=!0;let e=m.value.split(``),t=function(e){return e.Literal=`literal`,e.Special=`special`,e}({}),n=t.Literal,r=``;for(let i of e){await l(50);let e=n;i===`<`?e=t.Special:i===`>`&&(e=t.Literal),n===t.Literal&&e===t.Special&&(g.value.content+=r,r=``),n===t.Special&&e===t.Literal&&(r=``),n===t.Literal&&e===t.Literal&&(g.value.content+=i,r=``),n=e}r&&(g.value.content+=r),m.value=``,h.value=!1}return(r,a)=>(i(),t(`div`,u,[e(`div`,d,[n(s(c),{modelValue:m.value,"onUpdate:modelValue":a[0]||=e=>m.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:_},null,8,[`modelValue`]),e(`button`,f,o(h.value?`Processing...`:`Send`),1)]),e(`div`,p,[a[1]||=e(`h3`,{"font-semibold":``},` Streaming Message `,-1),e(`div`,null,o(g.value.content),1)])]))}}),h=m;export{h as default}; \ No newline at end of file +import{createBaseVNode as e,createElementBlock as t,createVNode as n,defineComponent as r,openBlock as i,ref as a,toDisplayString as o,unref as s}from"./index-DKziOBM4.js";import"./src-CmPNYgc5.js";import"./Basic-C8g-kAol.js";import{Textarea_default as c}from"./Textarea-BIh0Stpi.js";import{sleep as l}from"./sleep-JdatAils.js";const u={flex:``,"flex-col":``,"gap-2":``,"p-2":``},d={flex:``,"flex-row":``,"gap-2":``},f={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},p={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var m=r({__name:`filter-message`,setup(r){let m=a(``),h=a(!1),g=a({content:``});async function _(){h.value=!0;let e=m.value.split(``),t=function(e){return e.Literal=`literal`,e.Special=`special`,e}({}),n=t.Literal,r=``;for(let i of e){await l(50);let e=n;i===`<`?e=t.Special:i===`>`&&(e=t.Literal),n===t.Literal&&e===t.Special&&(g.value.content+=r,r=``),n===t.Special&&e===t.Literal&&(r=``),n===t.Literal&&e===t.Literal&&(g.value.content+=i,r=``),n=e}r&&(g.value.content+=r),m.value=``,h.value=!1}return(r,a)=>(i(),t(`div`,u,[e(`div`,d,[n(s(c),{modelValue:m.value,"onUpdate:modelValue":a[0]||=e=>m.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:_},null,8,[`modelValue`]),e(`button`,f,o(h.value?`Processing...`:`Send`),1)]),e(`div`,p,[a[1]||=e(`h3`,{"font-semibold":``},` Streaming Message `,-1),e(`div`,null,o(g.value.content),1)])]))}}),h=m;export{h as default}; \ No newline at end of file diff --git a/assets/fireworks-ai-Bi6np0qU.js b/assets/fireworks-ai-eLraL8LE.js similarity index 82% rename from assets/fireworks-ai-Bi6np0qU.js rename to assets/fireworks-ai-eLraL8LE.js index b56624d0e78b3aa4c0d54e59054e323b5f4aae4a..f02064e0e846ecb80cf9f5d8dbdaf5610eeace68 100644 --- a/assets/fireworks-ai-Bi6np0qU.js +++ b/assets/fireworks-ai-eLraL8LE.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`fireworks-ai`;var x=r({__name:`fireworks-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.fireworks.ai/inference/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`fireworks-ai`;var x=r({__name:`fireworks-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.fireworks.ai/inference/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/general-CsrImEU_.js b/assets/general-DWdxQoRL.js similarity index 83% rename from assets/general-CsrImEU_.js rename to assets/general-DWdxQoRL.js index ab0452eb6aae96886e6a094ff4588c8833331c96..d195ede73be18f6964dcd835f646cf57f5ef059e 100644 --- a/assets/general-CsrImEU_.js +++ b/assets/general-DWdxQoRL.js @@ -1 +1 @@ -import{Fragment as e,createBaseVNode as t,createElementBlock as n,createTextVNode as r,createVNode as i,defineComponent as a,isRef as o,openBlock as s,resolveDirective as c,toDisplayString as l,unref as u,useDark as d,useSettings as f,vModelSelect as p,withDirectives as m}from"./index-BSwg6FIo.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as h}from"./route-block-CC3cgg4Q.js";import{CheckBar_default as g}from"./CheckBar-eDXKHwAa.js";const _={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:280,delay:3*50,transition:`all ease-in-out duration-250`},v={value:`en-US`},y={value:`zh-CN`},b={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var x=a({__name:`general`,setup(a){let h=f(),x=d();return(a,d)=>{let f=c(`motion`);return s(),n(e,null,[m(i(g,{modelValue:u(x),"onUpdate:modelValue":d[0]||=e=>o(x)?x.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,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`]),[[f]]),m((s(),n(`div`,_,[r(l(a.$t(`settings.language.title`))+` `,1),m(t(`select`,{"onUpdate:modelValue":d[1]||=e=>u(h).language=e,transition:`all ease-in-out duration-250`,"cursor-pointer":``,"bg-transparent":``,"text-right":``,"outline-none":``},[t(`option`,v,l(a.$t(`settings.language.english`)),1),t(`option`,y,l(a.$t(`settings.language.chinese`)),1)],512),[[p,u(h).language]])])),[[f]]),m((s(),n(`div`,b,d[2]||=[t(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[f]])],64)}}});typeof h==`function`&&h(x);var S=x;export{S as default}; \ No newline at end of file +import{Fragment as e,createBaseVNode as t,createElementBlock as n,createTextVNode as r,createVNode as i,defineComponent as a,isRef as o,openBlock as s,resolveDirective as c,toDisplayString as l,unref as u,useDark as d,useSettings as f,vModelSelect as p,withDirectives as m}from"./index-DKziOBM4.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as h}from"./route-block-CC3cgg4Q.js";import{CheckBar_default as g}from"./CheckBar-CLfRTriv.js";const _={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:280,delay:3*50,transition:`all ease-in-out duration-250`},v={value:`en-US`},y={value:`zh-CN`},b={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var x=a({__name:`general`,setup(a){let h=f(),x=d();return(a,d)=>{let f=c(`motion`);return s(),n(e,null,[m(i(g,{modelValue:u(x),"onUpdate:modelValue":d[0]||=e=>o(x)?x.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,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`]),[[f]]),m((s(),n(`div`,_,[r(l(a.$t(`settings.language.title`))+` `,1),m(t(`select`,{"onUpdate:modelValue":d[1]||=e=>u(h).language=e,transition:`all ease-in-out duration-250`,"cursor-pointer":``,"bg-transparent":``,"text-right":``,"outline-none":``},[t(`option`,v,l(a.$t(`settings.language.english`)),1),t(`option`,y,l(a.$t(`settings.language.chinese`)),1)],512),[[p,u(h).language]])])),[[f]]),m((s(),n(`div`,b,d[2]||=[t(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[f]])],64)}}});typeof h==`function`&&h(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/google-generative-ai-C9ebffYb.js b/assets/google-generative-ai-OPnnnKDe.js similarity index 84% rename from assets/google-generative-ai-C9ebffYb.js rename to assets/google-generative-ai-OPnnnKDe.js index 91efecea9eab83cf26bdb566ecaae24355cf27b3..c6e950c03903daadd48ea0daa868a3fed885081f 100644 --- a/assets/google-generative-ai-C9ebffYb.js +++ b/assets/google-generative-ai-OPnnnKDe.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`google-generative-ai`;var x=r({__name:`google-generative-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;C.value[b]||(C.value[b]={baseUrl:`https://api.anthropic.com/v1/`}),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://generativelanguage.googleapis.com/v1beta/openai/`}});function D(){C.value[b]={baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName||`Google | Gemini`,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName||`Google`,placeholder:`GEMINI_API_KEY`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://generativelanguage.googleapis.com/v1beta/openai/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`google-generative-ai`;var x=r({__name:`google-generative-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;C.value[b]||(C.value[b]={baseUrl:`https://api.anthropic.com/v1/`}),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://generativelanguage.googleapis.com/v1beta/openai/`}});function D(){C.value[b]={baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName||`Google | Gemini`,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName||`Google`,placeholder:`GEMINI_API_KEY`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://generativelanguage.googleapis.com/v1beta/openai/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/home-YO2AF9Ir.js b/assets/home-ZzY7AMxo.js similarity index 88% rename from assets/home-YO2AF9Ir.js rename to assets/home-ZzY7AMxo.js index eda9c51c67a3f0dc51400dcf8e29f7697df827a6..a12076e76b3119613a9bb1a7d0af4ebb09bb1578 100644 --- a/assets/home-YO2AF9Ir.js +++ b/assets/home-ZzY7AMxo.js @@ -1 +1 @@ -import{RouterView as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,unref as o}from"./index-BSwg6FIo.js";const s={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},c={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"h-full":``};var l=i({__name:`home`,setup(i){return(i,l)=>(a(),n(`div`,s,[t(`div`,c,[r(o(e))])]))}}),u=l;export{u as default}; \ No newline at end of file +import{RouterView as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,unref as o}from"./index-DKziOBM4.js";const s={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},c={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"h-full":``};var l=i({__name:`home`,setup(i){return(i,l)=>(a(),n(`div`,s,[t(`div`,c,[r(o(e))])]))}}),u=l;export{u as default}; \ No newline at end of file diff --git a/assets/image-Dpb9pDE7.js b/assets/image--dKP-ZlZ.js similarity index 95% rename from assets/image-Dpb9pDE7.js rename to assets/image--dKP-ZlZ.js index efe67af5fbf0d9816bed5c8f26441fc23aec247d..b52636c471ab4988a773596b71e680e81c16f5a4 100644 --- a/assets/image-Dpb9pDE7.js +++ b/assets/image--dKP-ZlZ.js @@ -1,2 +1,2 @@ -import{__plugin_vue_export_helper_default as e,createBaseVNode as t,createCommentVNode as n,createElementBlock as r,defineComponent as i,openBlock as a,ref as o,toDisplayString as s,unref as c,useClipboard as l}from"./index-BSwg6FIo.js";const u={bg:`neutral-100`,flex:`~ col`,"items-center":``,"justify-center":``,"rounded-lg":``,"px-4":``,"py-3":``},d={key:0},f=[`src`],p={bg:`neutral-100`,class:`text-wrap-any`,"max-h":`100`,"overflow-scroll":``,"rounded-lg":``,"text-wrap":``,"text-black":``,"font-mono":``};var m=i({__name:`image`,setup(e){let i=o(),m=o(``),{copy:h}=l({source:m});async function g(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{var n;t(((n=e.target)==null||(n=n.result)==null?void 0:n.toString())||``)},r.onerror=e=>{n(e)},r.readAsDataURL(e)})}async function _(e){var t;let n=e.target,r=(t=n.files)?.[0];if(r){i.value=r;let e=await g(r);m.value=e}}return(e,i)=>(a(),r(`div`,null,[t(`label`,u,[t(`input`,{type:`file`,accept:`image/*`,hidden:``,onChange:_},null,32),i[1]||=t(`span`,null,`Upload Image`,-1)]),m.value?(a(),r(`div`,d,[t(`img`,{src:m.value,alt:`Uploaded Image`,"w-100":``},null,8,f),t(`pre`,p,` `+s(m.value)+` +import{__plugin_vue_export_helper_default as e,createBaseVNode as t,createCommentVNode as n,createElementBlock as r,defineComponent as i,openBlock as a,ref as o,toDisplayString as s,unref as c,useClipboard as l}from"./index-DKziOBM4.js";const u={bg:`neutral-100`,flex:`~ col`,"items-center":``,"justify-center":``,"rounded-lg":``,"px-4":``,"py-3":``},d={key:0},f=[`src`],p={bg:`neutral-100`,class:`text-wrap-any`,"max-h":`100`,"overflow-scroll":``,"rounded-lg":``,"text-wrap":``,"text-black":``,"font-mono":``};var m=i({__name:`image`,setup(e){let i=o(),m=o(``),{copy:h}=l({source:m});async function g(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{var n;t(((n=e.target)==null||(n=n.result)==null?void 0:n.toString())||``)},r.onerror=e=>{n(e)},r.readAsDataURL(e)})}async function _(e){var t;let n=e.target,r=(t=n.files)?.[0];if(r){i.value=r;let e=await g(r);m.value=e}}return(e,i)=>(a(),r(`div`,null,[t(`label`,u,[t(`input`,{type:`file`,accept:`image/*`,hidden:``,onChange:_},null,32),i[1]||=t(`span`,null,`Upload Image`,-1)]),m.value?(a(),r(`div`,d,[t(`img`,{src:m.value,alt:`Uploaded Image`,"w-100":``},null,8,f),t(`pre`,p,` `+s(m.value)+` `,1),t(`button`,{bg:`primary-500`,text:`white`,"mt-4":``,"rounded-lg":``,"px-4":``,"py-2":``,onClick:i[0]||=()=>c(h)()},` Copy Data URL `)])):n(``,!0)]))}}),h=e(m,[[`__scopeId`,`data-v-7edd53e6`]]);export{h as default}; \ No newline at end of file diff --git a/assets/index-CISmcbXk-D9DoS9jO.js b/assets/index-CISmcbXk-DB1OKNbQ.js similarity index 64% rename from assets/index-CISmcbXk-D9DoS9jO.js rename to assets/index-CISmcbXk-DB1OKNbQ.js index 1d75069693a0ff564eac6f6e94b74332abf9d9cf..34571d6a6b93f69b8f038d3301187b222ee4ab05 100644 --- a/assets/index-CISmcbXk-D9DoS9jO.js +++ b/assets/index-CISmcbXk-DB1OKNbQ.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/effect-WSjEuzC9-C7hO9AAX.js","assets/index-BSwg6FIo.js","assets/index-5P7QcyEX.css","assets/sury-DmrZ3_Oj-BVfox27b.js","assets/valibot-CQk-M5rL-D-3BXXqj.js","assets/zod-Db63SLXj-DHTxeu7T.js"])))=>i.map(i=>d[i]); -import{__vitePreload as e}from"./index-BSwg6FIo.js";const t=`https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies`,n=async(e,n)=>{try{return await e}catch{throw Error(`xsschema: Missing dependencies "${n}". see ${t}`)}},r=async t=>{switch(t){case`arktype`:return e(()=>import(`./arktype-C-GObzDh-CmNSnR89.js`),[]).then(async({getToJsonSchemaFn:e})=>e());case`effect`:return e(()=>import(`./effect-WSjEuzC9-C7hO9AAX.js`),__vite__mapDeps([0,1,2])).then(async({getToJsonSchemaFn:e})=>e());case`sury`:return e(()=>import(`./sury-DmrZ3_Oj-BVfox27b.js`),__vite__mapDeps([3,1,2])).then(async({getToJsonSchemaFn:e})=>e());case`valibot`:return e(()=>import(`./valibot-CQk-M5rL-D-3BXXqj.js`),__vite__mapDeps([4,1,2])).then(async({getToJsonSchemaFn:e})=>e());case`zod`:return e(()=>import(`./zod-Db63SLXj-DHTxeu7T.js`),__vite__mapDeps([5,1,2])).then(async({getToJsonSchemaFn:e})=>e());default:throw Error(`xsschema: Unsupported schema vendor "${t}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`)}},i=async e=>r(e[`~standard`].vendor).then(async t=>t(e));export{t as missingDependenciesUrl,i as toJsonSchema,n as tryImport}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/effect-WSjEuzC9-BizqJV0H.js","assets/index-DKziOBM4.js","assets/index-5P7QcyEX.css","assets/sury-DmrZ3_Oj-DcdBDUxn.js","assets/valibot-CQk-M5rL-CUQV5usc.js","assets/zod-Db63SLXj-Bb2KbiPR.js"])))=>i.map(i=>d[i]); +import{__vitePreload as e}from"./index-DKziOBM4.js";const t=`https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies`,n=async(e,n)=>{try{return await e}catch{throw Error(`xsschema: Missing dependencies "${n}". see ${t}`)}},r=async t=>{switch(t){case`arktype`:return e(()=>import(`./arktype-C-GObzDh-CmNSnR89.js`),[]).then(async({getToJsonSchemaFn:e})=>e());case`effect`:return e(()=>import(`./effect-WSjEuzC9-BizqJV0H.js`),__vite__mapDeps([0,1,2])).then(async({getToJsonSchemaFn:e})=>e());case`sury`:return e(()=>import(`./sury-DmrZ3_Oj-DcdBDUxn.js`),__vite__mapDeps([3,1,2])).then(async({getToJsonSchemaFn:e})=>e());case`valibot`:return e(()=>import(`./valibot-CQk-M5rL-CUQV5usc.js`),__vite__mapDeps([4,1,2])).then(async({getToJsonSchemaFn:e})=>e());case`zod`:return e(()=>import(`./zod-Db63SLXj-Bb2KbiPR.js`),__vite__mapDeps([5,1,2])).then(async({getToJsonSchemaFn:e})=>e());default:throw Error(`xsschema: Unsupported schema vendor "${t}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`)}},i=async e=>r(e[`~standard`].vendor).then(async t=>t(e));export{t as missingDependenciesUrl,i as toJsonSchema,n as tryImport}; \ No newline at end of file diff --git a/assets/index-BSwg6FIo.js b/assets/index-DKziOBM4.js similarity index 98% rename from assets/index-BSwg6FIo.js rename to assets/index-DKziOBM4.js index 5c8db3d7fe3539f9ee74e3e80cf94488f06bb6d6..f97b393687c3cb7950eb2ebb40ccdb1914f3bc79 100644 --- a/assets/index-BSwg6FIo.js +++ b/assets/index-DKziOBM4.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-Db8QsuAx.js","assets/HeaderLink-rfbghXs_.js","assets/HeaderLink-Bxs3yYEi.css","assets/settings-_CwCCEeu.js","assets/components-DetbLrEi.js","assets/import-url-browser-DNuYZxPr.js","assets/duckdb-mvp-C3i5IjU8.js","assets/src-CX9nVT7I.js","assets/src-B8Pazang.css","assets/composables-BpmQTBvS.js","assets/stores-BzkLfyIH.js","assets/dist-D1uPCnfx.js","assets/webgpu-aYTuek9b.js","assets/index-CISmcbXk-D9DoS9jO.js","assets/types-Ba2_UENo.js","assets/queue-Cw0r8hJ-.js","assets/queues-XZuprNy-.js","assets/sleep-CvjNLutj.js","assets/__vite-browser-external-CoPuN2cl.js","assets/Button-AEge-Qyg.js","assets/Button-D6PjaMaR.css","assets/components-CXqNLZbx.css","assets/pages-BuUyaRGx.js","assets/route-block-CC3cgg4Q.js","assets/pages-Deu5sZkY.css","assets/background-remove-BBVN5gMF.js","assets/InputFile-R2knYJRe.js","assets/chat-6NJMDnl7.js","assets/image-Dpb9pDE7.js","assets/image-BhuwcwI9.css","assets/polaroid-DbFi6Mzo.js","assets/vibrant-CBTz7DBe.js","assets/browser-_6RX04wP.js","assets/queue-NqCetSQS.js","assets/settings-Bw5r_FJh.js","assets/IconAnimation-LJjhLEIS.js","assets/airi-card-gp_HXphd.js","assets/CardCreate-D42uwy43.js","assets/CardCreationDialog-BsyNmiYp.js","assets/dist-BziUufTI.js","assets/CardCreationDialog-Ic9YpxxK.css","assets/CardDetailDialog-BCybvJ8-.js","assets/DeleteCardDialog-DFZll3ve.js","assets/CardListItem-C9XT5lUo.js","assets/CardCreate-93Vgljnn.js","assets/CardCreationDialog-DOEDNVJJ.js","assets/CardDetailDialog-McUMnIHp.js","assets/CardListItem-KoeisllI.js","assets/DeleteCardDialog-ChdXAy_R.js","assets/appearance-B6qqUE9Q.js","assets/color-scheme-BB8LYAOa.js","assets/ColorPalette-BdHvvd1C.js","assets/color-scheme-CHJXy8qz.css","assets/developer-Dt-sXJ7n.js","assets/CheckBar-eDXKHwAa.js","assets/general-CsrImEU_.js","assets/memory-DrUUBYPC.js","assets/models-BJIpJbS2.js","assets/useIconAnimation-DBzeTvDN.js","assets/models-BR8YPV_e.css","assets/modules-oFdrgpO7.js","assets/consciousness-NuFD6MD2.js","assets/memory-long-term-DUBmUqi4.js","assets/memory-short-term-wHAWQOw0.js","assets/speech-CjA8Vt_G.js","assets/Basic-BGRWPjtG.js","assets/Textarea-CuugR8VV.js","assets/providers-B-S3_fuC.js","assets/alibaba-cloud-model-studio-BPpbwzjz.js","assets/anthropic-D6Mj8Jul.js","assets/cloudflare-workers-ai-C4yLEnia.js","assets/deepseek-BqMiLukk.js","assets/elevenlabs-3r9LKRu7.js","assets/featherless-ai-jAdyMyy3.js","assets/fireworks-ai-Bi6np0qU.js","assets/google-generative-ai-C9ebffYb.js","assets/microsoft-speech-D91uNSKl.js","assets/mistral-ai-B6ubU7d4.js","assets/moonshot-ai-Gb1o961w.js","assets/novita-ai-DZ-Vz6US.js","assets/ollama-NSTufMsI.js","assets/openai-CRDWRKN8.js","assets/openai-audio-speech-CstZTITX.js","assets/openai-audio-transcription-IjkiOEt-.js","assets/openrouter-ai-mKjCEqCW.js","assets/player2-api-DYzC8-m3.js","assets/together-ai-DnlRcpSP.js","assets/volcengine-CUaCa6hT.js","assets/xai-CvGLXM75.js","assets/scene-sC31UkJB.js","assets/stage-BkAPr8zf.js","assets/stage-DPSvNNh_.css","assets/filter-message-C1Dba7ss.js","assets/delays-DVvIZeUS.js","assets/emotions-SSc0a-LV.js","assets/messages-BWcBoWro.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-xnAH3KmJ.js","assets/HeaderLink-vGMDgqa7.js","assets/HeaderLink-Bxs3yYEi.css","assets/settings-D1j-vsv3.js","assets/components-BvWgWMX4.js","assets/import-url-browser-DNuYZxPr.js","assets/duckdb-mvp-C3i5IjU8.js","assets/src-CmPNYgc5.js","assets/src-B8Pazang.css","assets/stores-zsAuCjXz.js","assets/composables-D7YQJsZO.js","assets/dist-D1uPCnfx.js","assets/webgpu-aYTuek9b.js","assets/index-CISmcbXk-DB1OKNbQ.js","assets/types-Ba2_UENo.js","assets/queue-D6mkPVC_.js","assets/queues-BZSFjE0u.js","assets/sleep-JdatAils.js","assets/__vite-browser-external-FU9M8lFq.js","assets/Button-DdtiAfEa.js","assets/Button-D6PjaMaR.css","assets/components-CXqNLZbx.css","assets/pages-DN0dVd_t.js","assets/route-block-CC3cgg4Q.js","assets/pages-Deu5sZkY.css","assets/background-remove-DWgFP94H.js","assets/InputFile-DEuushJG.js","assets/chat-B0HcMONu.js","assets/image--dKP-ZlZ.js","assets/image-BhuwcwI9.css","assets/polaroid-BoXbUjSB.js","assets/vibrant-Cho7xMN6.js","assets/browser-_6RX04wP.js","assets/queue-DeMWSQ3F.js","assets/settings-DWdpldbJ.js","assets/IconAnimation-D-xhKJXy.js","assets/airi-card-B_A3U3hx.js","assets/CardCreate-4reXB0pk.js","assets/CardCreationDialog-Cv_Hyp_I.js","assets/dist-B_AZqzk2.js","assets/CardCreationDialog-Ic9YpxxK.css","assets/CardDetailDialog-CONcxyTr.js","assets/DeleteCardDialog-cPOegSR1.js","assets/CardListItem-Df8jJDtb.js","assets/CardCreate-DIURsdhI.js","assets/CardCreationDialog-DPBvL_ac.js","assets/CardDetailDialog-DnvIbrvr.js","assets/CardListItem-BpM5aZB-.js","assets/DeleteCardDialog-BoKcjVsa.js","assets/appearance-t6hovndX.js","assets/color-scheme-DpRkLhr5.js","assets/ColorPalette-BB1UoLey.js","assets/color-scheme-CHJXy8qz.css","assets/developer-BDrLqOcT.js","assets/CheckBar-CLfRTriv.js","assets/general-DWdxQoRL.js","assets/memory-DkrmmiHt.js","assets/models-76vvgGXm.js","assets/useIconAnimation-DZK17st3.js","assets/models-BR8YPV_e.css","assets/modules-BnTzg3CJ.js","assets/consciousness-DGt-Az-C.js","assets/memory-long-term-DhH1haWG.js","assets/memory-short-term-ZF-2h-kI.js","assets/speech-Bw68A32w.js","assets/Basic-C8g-kAol.js","assets/Textarea-BIh0Stpi.js","assets/providers-CMOdvsid.js","assets/alibaba-cloud-model-studio-DKtpBeWj.js","assets/anthropic-DCrOC5Oo.js","assets/cloudflare-workers-ai-Cso4_BGA.js","assets/deepseek-BzDEswlr.js","assets/elevenlabs-DrNId1mR.js","assets/featherless-ai-Ca5fPlYY.js","assets/fireworks-ai-eLraL8LE.js","assets/google-generative-ai-OPnnnKDe.js","assets/microsoft-speech-BzMvh9G0.js","assets/mistral-ai-BfFFEoJ2.js","assets/moonshot-ai-UFXQvwF7.js","assets/novita-ai-CHDoxp4K.js","assets/ollama-cl0Rrnvz.js","assets/openai-CdWtYSM3.js","assets/openai-audio-speech-92ozaSwL.js","assets/openai-audio-transcription-CWLk8_6R.js","assets/openrouter-ai-DJ3Pwf8-.js","assets/player2-api-B_cW5fsP.js","assets/together-ai-BcVdn6ff.js","assets/volcengine-BNR9YCJ3.js","assets/xai-CePM5sec.js","assets/scene-DrliOSzk.js","assets/stage-rGESOq2q.js","assets/stage-DPSvNNh_.css","assets/filter-message-ByGUaxmz.js","assets/delays-DFcn4gRF.js","assets/emotions-EE6Y-cSt.js","assets/messages-ChSNCEvv.js"])))=>i.map(i=>d[i]); var e=function(exports){function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}return exports.defineProperty=i,exports}({}),t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;lt[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),f=e=>u(n({},`__esModule`,{value:!0}),e),p=e=>t=>d(t.default,e),m=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e){if(t.type!==`childList`)continue;for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(); /** * @vue/shared v3.5.17 @@ -3828,7 +3828,7 @@ void main() { }`;var Dk=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){let r=new mm,i=e.properties.get(r);i.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new Lg({vertexShader:Tk,fragmentShader:Ek,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Eg(new Eb(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},Ok=class extends fp{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=new Dk,h=t.getContextAttributes(),g=null,_=null,v=[],y=[],b=new U,x=null,S=new Hg;S.viewport=new hm;let C=new Hg;C.viewport=new hm;let w=[S,C],T=new hS,E=null,D=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=v[e];return t===void 0&&(t=new Xg,v[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=v[e];return t===void 0&&(t=new Xg,v[e]=t),t.getGripSpace()},this.getHand=function(e){let t=v[e];return t===void 0&&(t=new Xg,v[e]=t),t.getHandSpace()};function O(e){let t=y.indexOf(e.inputSource);if(t===-1)return;let n=v[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function k(){r.removeEventListener(`select`,O),r.removeEventListener(`selectstart`,O),r.removeEventListener(`selectend`,O),r.removeEventListener(`squeeze`,O),r.removeEventListener(`squeezestart`,O),r.removeEventListener(`squeezeend`,O),r.removeEventListener(`end`,k),r.removeEventListener(`inputsourceschange`,A);for(let e=0;e=0&&(y[r]=null,v[r].disconnect(n))}for(let t=0;t=y.length){y.push(n),r=e;break}else if(y[e]===null){y[e]=n,r=e;break}if(r===-1)break}let i=v[r];i&&i.connect(n)}}let j=new W,M=new W;function N(e,t,n){j.setFromMatrixPosition(t.matrixWorld),M.setFromMatrixPosition(n.matrixWorld);let r=j.distanceTo(M),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function ee(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;m.texture!==null&&(m.depthNear>0&&(t=m.depthNear),m.depthFar>0&&(n=m.depthFar)),T.near=C.near=S.near=t,T.far=C.far=S.far=n,(E!==T.near||D!==T.far)&&(r.updateRenderState({depthNear:T.near,depthFar:T.far}),E=T.near,D=T.far),S.layers.mask=e.layers.mask|2,C.layers.mask=e.layers.mask|4,T.layers.mask=S.layers.mask|C.layers.mask;let i=e.parent,a=T.cameras;ee(T,i);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,kk.copy(o),kk.x*=-1,kk.y*=-1,kk.z*=-1,a.isCubeTexture&&a.isRenderTargetTexture===!1&&(kk.y*=-1,kk.z*=-1),e.envMapRotation.value.setFromMatrix4(Ak.makeRotationFromEuler(kk)),e.flipEnvMap.value=a.isCubeTexture&&a.isRenderTargetTexture===!1?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===Rl&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function Mk(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(m(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,g));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(f(e),a[e.id]=c)}function u(t){let n=d();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function d(){for(let e=0;e0&&(n+=r-i),e.__size=n,e.__cache={},this}function h(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn(`THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.`):console.warn(`THREE.WebGLRenderer: Unsupported uniform value type.`,e),t}function g(t){let n=t.target;n.removeEventListener(`dispose`,g);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function _(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:_}}var Nk=class{constructor(e={}){let{canvas:t=Yp(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);f=n.getContextAttributes().alpha}else f=a;let p=new Uint32Array(4),m=new Int32Array(4),h=null,g=null,_=[],v=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Cu,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let y=this,b=!1;this._outputColorSpace=Sf;let x=0,S=0,C=null,w=-1,T=null,E=new hm,D=new hm,O=null,k=new K(0),A=0,j=t.width,M=t.height,N=1,ee=null,te=null,P=new hm(0,0,j,M),ne=new hm(0,0,j,M),re=!1,ie=new Q_,ae=!1,oe=!1,se=new G,ce=new G,le=new W,ue=new hm,de={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},fe=!1;function pe(){return C===null?N:1}let F=n;function me(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r${El}`),t.addEventListener(`webglcontextlost`,ze,!1),t.addEventListener(`webglcontextrestored`,Be,!1),t.addEventListener(`webglcontextcreationerror`,Ve,!1),F===null){let t=`webgl2`;if(F=me(t,e),F===null)throw me(t)?Error(`Error creating WebGL context with your selected attributes.`):Error(`Error creating WebGL context.`)}}catch(e){throw console.error(`THREE.WebGLRenderer: `+e.message),e}let he,ge,I,_e,L,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie;function Le(){he=new fD(F),he.init(),Pe=new wk(F,he),ge=new VE(F,he,e,Pe),I=new Sk(F,he),ge.reverseDepthBuffer&&d&&I.buffers.depth.setReversed(!0),_e=new hD(F),L=new ok,ve=new Ck(F,he,I,L,ge,Pe,_e),ye=new UE(y),be=new dD(y),xe=new $C(F),Fe=new zE(F,xe),Se=new pD(F,xe,_e,Fe),Ce=new _D(F,Se,xe,_e),je=new gD(F,ge,ve),Oe=new HE(L),we=new ak(y,ye,be,he,ge,Fe,Oe),Te=new jk(y,L),Ee=new uk,De=new _k(he),Ae=new RE(y,ye,be,I,Ce,f,s),ke=new bk(y,Ce,ge),Ie=new Mk(F,_e,ge,I),Me=new BE(F,he,_e),Ne=new mD(F,he,_e),_e.programs=we.programs,y.capabilities=ge,y.extensions=he,y.properties=L,y.renderLists=Ee,y.shadowMap=ke,y.state=I,y.info=_e}Le();let Re=new Ok(y,F);this.xr=Re,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){let e=he.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=he.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return N},this.setPixelRatio=function(e){e!==void 0&&(N=e,this.setSize(j,M,!1))},this.getSize=function(e){return e.set(j,M)},this.setSize=function(e,n,r=!0){if(Re.isPresenting){console.warn(`THREE.WebGLRenderer: Can't change size while VR device is presenting.`);return}j=e,M=n,t.width=Math.floor(e*N),t.height=Math.floor(n*N),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(j*N,M*N).floor()},this.setDrawingBufferSize=function(e,n,r){j=e,M=n,N=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(E)},this.getViewport=function(e){return e.copy(P)},this.setViewport=function(e,t,n,r){e.isVector4?P.set(e.x,e.y,e.z,e.w):P.set(e,t,n,r),I.viewport(E.copy(P).multiplyScalar(N).round())},this.getScissor=function(e){return e.copy(ne)},this.setScissor=function(e,t,n,r){e.isVector4?ne.set(e.x,e.y,e.z,e.w):ne.set(e,t,n,r),I.scissor(D.copy(ne).multiplyScalar(N).round())},this.getScissorTest=function(){return re},this.setScissorTest=function(e){I.setScissorTest(re=e)},this.setOpaqueSort=function(e){ee=e},this.setTransparentSort=function(e){te=e},this.getClearColor=function(e){return e.copy(Ae.getClearColor())},this.setClearColor=function(){Ae.setClearColor(...arguments)},this.getClearAlpha=function(){return Ae.getClearAlpha()},this.setClearAlpha=function(){Ae.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(C!==null){let t=C.texture.format;e=t===bd||t===vd||t===gd}if(e){let e=C.texture.type,t=e===Qu||e===rd||e===td||e===cd||e===od||e===sd,n=Ae.getClearColor(),r=Ae.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(p[0]=i,p[1]=a,p[2]=o,p[3]=r,F.clearBufferuiv(F.COLOR,0,p)):(m[0]=i,m[1]=a,m[2]=o,m[3]=r,F.clearBufferiv(F.COLOR,0,m))}else r|=F.COLOR_BUFFER_BIT}t&&(r|=F.DEPTH_BUFFER_BIT),n&&(r|=F.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),F.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener(`webglcontextlost`,ze,!1),t.removeEventListener(`webglcontextrestored`,Be,!1),t.removeEventListener(`webglcontextcreationerror`,Ve,!1),Ae.dispose(),Ee.dispose(),De.dispose(),L.dispose(),ye.dispose(),be.dispose(),Ce.dispose(),Fe.dispose(),Ie.dispose(),we.dispose(),Re.dispose(),Re.removeEventListener(`sessionstart`,Je),Re.removeEventListener(`sessionend`,Ye),Xe.stop()};function ze(e){e.preventDefault(),console.log(`THREE.WebGLRenderer: Context Lost.`),b=!0}function Be(){console.log(`THREE.WebGLRenderer: Context Restored.`),b=!1;let e=_e.autoReset,t=ke.enabled,n=ke.autoUpdate,r=ke.needsUpdate,i=ke.type;Le(),_e.autoReset=e,ke.enabled=t,ke.autoUpdate=n,ke.needsUpdate=r,ke.type=i}function Ve(e){console.error(`THREE.WebGLRenderer: A WebGL context could not be created. Reason: `,e.statusMessage)}function He(e){let t=e.target;t.removeEventListener(`dispose`,He),Ue(t)}function Ue(e){We(e),L.remove(e)}function We(e){let t=L.get(e).programs;t!==void 0&&(t.forEach(function(e){we.releaseProgram(e)}),e.isShaderMaterial&&we.releaseShaderCache(e))}this.renderBufferDirect=function(e,t,n,r,i,a){t===null&&(t=de);let o=i.isMesh&&i.matrixWorld.determinant()<0,s=at(e,t,n,r,i);I.setMaterial(r,o);let c=n.index,l=1;if(r.wireframe===!0){if(c=Se.getWireframeAttribute(n),c===void 0)return;l=2}let u=n.drawRange,d=n.attributes.position,f=u.start*l,p=(u.start+u.count)*l;a!==null&&(f=Math.max(f,a.start*l),p=Math.min(p,(a.start+a.count)*l)),c===null?d!=null&&(f=Math.max(f,0),p=Math.min(p,d.count)):(f=Math.max(f,0),p=Math.min(p,c.count));let m=p-f;if(m<0||m===1/0)return;Fe.setup(i,r,s,n,c);let h,g=Me;if(c!==null&&(h=xe.get(c),g=Ne,g.setIndex(h)),i.isMesh)r.wireframe===!0?(I.setLineWidth(r.wireframeLinewidth*pe()),g.setMode(F.LINES)):g.setMode(F.TRIANGLES);else if(i.isLine){let e=r.linewidth;e===void 0&&(e=1),I.setLineWidth(e*pe()),i.isLineSegments?g.setMode(F.LINES):i.isLineLoop?g.setMode(F.LINE_LOOP):g.setMode(F.LINE_STRIP)}else i.isPoints?g.setMode(F.POINTS):i.isSprite&&g.setMode(F.TRIANGLES);if(i.isBatchedMesh)if(i._multiDrawInstances!==null)Zp(`THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.`),g.renderMultiDrawInstances(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount,i._multiDrawInstances);else if(he.get(`WEBGL_multi_draw`))g.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{let e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,a=c?xe.get(c).bytesPerElement:1,o=L.get(r).currentProgram.getUniforms();for(let r=0;r{function n(){if(r.forEach(function(e){let t=L.get(e),n=t.currentProgram;n.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}he.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let Ke=null;function qe(e){Ke&&Ke(e)}function Je(){Xe.stop()}function Ye(){Xe.start()}let Xe=new QC;Xe.setAnimationLoop(qe),typeof self<`u`&&Xe.setContext(self),this.setAnimationLoop=function(e){Ke=e,Re.setAnimationLoop(e),e===null?Xe.stop():Xe.start()},Re.addEventListener(`sessionstart`,Je),Re.addEventListener(`sessionend`,Ye),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){console.error(`THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(b===!0)return;if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),Re.enabled===!0&&Re.isPresenting===!0&&(Re.cameraAutoUpdate===!0&&Re.updateCamera(t),t=Re.getCamera()),e.isScene===!0&&e.onBeforeRender(y,e,t,C),g=De.get(e,v.length),g.init(t),v.push(g),ce.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ie.setFromProjectionMatrix(ce),oe=this.localClippingEnabled,ae=Oe.init(this.clippingPlanes,oe),h=Ee.get(e,_.length),h.init(),_.push(h),Re.enabled===!0&&Re.isPresenting===!0){let e=y.xr.getDepthSensingMesh();e!==null&&Ze(e,t,-1/0,y.sortObjects)}Ze(e,t,0,y.sortObjects),h.finish(),y.sortObjects===!0&&h.sort(ee,te),fe=Re.enabled===!1||Re.isPresenting===!1||Re.hasDepthSensing()===!1,fe&&Ae.addToRenderList(h,e),this.info.render.frame++,ae===!0&&Oe.beginShadows();let n=g.state.shadowsArray;ke.render(n,e,t),ae===!0&&Oe.endShadows(),this.info.autoReset===!0&&this.info.reset();let r=h.opaque,i=h.transmissive;if(g.setupLights(),t.isArrayCamera){let n=t.cameras;if(i.length>0)for(let t=0,a=n.length;t0&&$e(r,i,e,t),fe&&Ae.render(e),Qe(h,e,t);C!==null&&S===0&&(ve.updateMultisampleRenderTarget(C),ve.updateRenderTargetMipmap(C)),e.isScene===!0&&e.onAfterRender(y,e,t),Fe.resetDefaultState(),w=-1,T=null,v.pop(),v.length>0?(g=v[v.length-1],ae===!0&&Oe.setGlobalState(y.clippingPlanes,g.state.camera)):g=null,_.pop(),h=_.length>0?_[_.length-1]:null};function Ze(e,t,n,r){if(e.visible===!1)return;let i=e.layers.test(t.layers);if(i){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLight)g.pushLight(e),e.castShadow&&g.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ie.intersectsSprite(e)){r&&ue.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ce);let t=Ce.update(e),i=e.material;i.visible&&h.push(e,t,i,n,ue.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ie.intersectsObject(e))){let t=Ce.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),ue.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),ue.copy(e.boundingSphere.center)),ue.applyMatrix4(e.matrixWorld).applyMatrix4(ce)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a0&&et(i,t,n),a.length>0&&et(a,t,n),o.length>0&&et(o,t,n),I.buffers.depth.setTest(!0),I.buffers.depth.setMask(!0),I.buffers.color.setMask(!0),I.setPolygonOffset(!1)}function $e(e,t,n,r){let a=n.isScene===!0?n.overrideMaterial:null;if(a!==null)return;g.state.transmissionRenderTarget[r.id]===void 0&&(g.state.transmissionRenderTarget[r.id]=new _m(1,1,{generateMipmaps:!0,type:he.has(`EXT_color_buffer_half_float`)||he.has(`EXT_color_buffer_float`)?ad:Qu,minFilter:Xu,samples:4,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:im.workingColorSpace}));let o=g.state.transmissionRenderTarget[r.id],s=r.viewport||E;o.setSize(s.z*y.transmissionResolutionScale,s.w*y.transmissionResolutionScale);let c=y.getRenderTarget();y.setRenderTarget(o),y.getClearColor(k),A=y.getClearAlpha(),A<1&&y.setClearColor(16777215,.5),y.clear(),fe&&Ae.render(n);let l=y.toneMapping;y.toneMapping=Cu;let u=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),g.setupLightsView(r),ae===!0&&Oe.setGlobalState(y.clippingPlanes,r),et(e,n,r),ve.updateMultisampleRenderTarget(o),ve.updateRenderTargetMipmap(o),he.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i0),d=!!n.morphAttributes.position,f=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=Cu;r.toneMapped&&(C===null||C.isXRRenderTarget===!0)&&(m=y.toneMapping);let h=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=h===void 0?0:h.length,v=L.get(r),b=g.state.lights;if(ae===!0&&(oe===!0||e!==T)){let t=e===T&&r.id===w;Oe.setState(r,e,t)}let x=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==b.state.version?x=!0:v.outputColorSpace===s?i.isBatchedMesh&&v.batching===!1||!i.isBatchedMesh&&v.batching===!0||i.isBatchedMesh&&v.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&v.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&v.instancing===!1||!i.isInstancedMesh&&v.instancing===!0||i.isSkinnedMesh&&v.skinning===!1||!i.isSkinnedMesh&&v.skinning===!0||i.isInstancedMesh&&v.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&v.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&v.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&v.instancingMorph===!1&&i.morphTexture!==null?x=!0:v.envMap===c?r.fog===!0&&v.fog!==a||v.numClippingPlanes!==void 0&&(v.numClippingPlanes!==Oe.numPlanes||v.numIntersection!==Oe.numIntersection)?x=!0:v.vertexAlphas===l&&v.vertexTangents===u&&v.morphTargets===d&&v.morphNormals===f&&v.morphColors===p&&v.toneMapping===m?v.morphTargetsCount!==_&&(x=!0):x=!0:x=!0:x=!0:(x=!0,v.__version=r.version);let S=v.currentProgram;x===!0&&(S=nt(r,t,i));let E=!1,D=!1,O=!1,k=S.getUniforms(),A=v.uniforms;if(I.useProgram(S.program)&&(E=!0,D=!0,O=!0),r.id!==w&&(w=r.id,D=!0),E||T!==e){let t=I.buffers.depth.getReversed();t?(se.copy(e.projectionMatrix),$p(se),em(se),k.setValue(F,`projectionMatrix`,se)):k.setValue(F,`projectionMatrix`,e.projectionMatrix),k.setValue(F,`viewMatrix`,e.matrixWorldInverse);let n=k.map.cameraPosition;n!==void 0&&n.setValue(F,le.setFromMatrixPosition(e.matrixWorld)),ge.logarithmicDepthBuffer&&k.setValue(F,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&k.setValue(F,`isOrthographic`,e.isOrthographicCamera===!0),T!==e&&(T=e,D=!0,O=!0)}if(i.isSkinnedMesh){k.setOptional(F,i,`bindMatrix`),k.setOptional(F,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),k.setValue(F,`boneTexture`,e.boneTexture,ve))}i.isBatchedMesh&&(k.setOptional(F,i,`batchingTexture`),k.setValue(F,`batchingTexture`,i._matricesTexture,ve),k.setOptional(F,i,`batchingIdTexture`),k.setValue(F,`batchingIdTexture`,i._indirectTexture,ve),k.setOptional(F,i,`batchingColorTexture`),i._colorsTexture!==null&&k.setValue(F,`batchingColorTexture`,i._colorsTexture,ve));let j=n.morphAttributes;if((j.position!==void 0||j.normal!==void 0||j.color!==void 0)&&je.update(i,n,S),(D||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,k.setValue(F,`receiveShadow`,i.receiveShadow)),r.isMeshGouraudMaterial&&r.envMap!==null&&(A.envMap.value=c,A.flipEnvMap.value=c.isCubeTexture&&c.isRenderTargetTexture===!1?-1:1),r.isMeshStandardMaterial&&r.envMap===null&&t.environment!==null&&(A.envMapIntensity.value=t.environmentIntensity),D&&(k.setValue(F,`toneMappingExposure`,y.toneMappingExposure),v.needsLights&&ot(A,O),a&&r.fog===!0&&Te.refreshFogUniforms(A,a),Te.refreshMaterialUniforms(A,r,N,M,g.state.transmissionRenderTarget[e.id]),wO.upload(F,rt(v),A,ve)),r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(wO.upload(F,rt(v),A,ve),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&k.setValue(F,`center`,i.center),k.setValue(F,`modelViewMatrix`,i.modelViewMatrix),k.setValue(F,`normalMatrix`,i.normalMatrix),k.setValue(F,`modelMatrix`,i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){let e=r.uniformsGroups;for(let t=0,n=e.length;t0&&ve.useMultisampledRTT(e)===!1?L.get(e).__webglMultisampledFramebuffer:Array.isArray(l)?l[n]:l,E.copy(e.viewport),D.copy(e.scissor),O=e.scissorTest}else E.copy(P).multiplyScalar(N).floor(),D.copy(ne).multiplyScalar(N).floor(),O=re;n!==0&&(i=ct);let s=I.bindFramebuffer(F.FRAMEBUFFER,i);if(s&&r&&I.drawBuffers(e,i),I.viewport(E),I.scissor(D),I.setScissorTest(O),a){let r=L.get(e.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(o){let r=L.get(e.texture),i=t;F.framebufferTextureLayer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,r.__webglTexture,n,i)}else if(e!==null&&n!==0){let t=L.get(e.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,t.__webglTexture,n)}w=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}let c=L.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){I.bindFramebuffer(F.FRAMEBUFFER,c);try{let o=e.textures[s],c=o.format,l=o.type;if(!ge.textureFormatReadable(c)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!ge.textureTypeReadable(l)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&(e.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+s),F.readPixels(t,n,r,i,Pe.convert(c),Pe.convert(l),a))}finally{let e=C===null?null:L.get(C).__webglFramebuffer;I.bindFramebuffer(F.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=L.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c)if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){I.bindFramebuffer(F.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(!ge.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!ge.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,d),F.bufferData(F.PIXEL_PACK_BUFFER,a.byteLength,F.STREAM_READ),e.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+s),F.readPixels(t,n,r,i,Pe.convert(l),Pe.convert(u),0);let f=C===null?null:L.get(C).__webglFramebuffer;I.bindFramebuffer(F.FRAMEBUFFER,f);let p=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);return F.flush(),await Qp(F,p,4),F.bindBuffer(F.PIXEL_PACK_BUFFER,d),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,a),F.deleteBuffer(d),F.deleteSync(p),a}else throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;ve.setTexture2D(e,0),F.copyTexSubImage2D(F.TEXTURE_2D,n,0,0,o,s,i,a),I.unbindTexture()};let lt=F.createFramebuffer(),ut=F.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=null){a===null&&(i===0?a=0:(Zp(`WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.`),a=i,i=0));let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=Pe.convert(t.format),_=Pe.convert(t.type),v;t.isData3DTexture?(ve.setTexture3D(t,0),v=F.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(ve.setTexture2DArray(t,0),v=F.TEXTURE_2D_ARRAY):(ve.setTexture2D(t,0),v=F.TEXTURE_2D),F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,t.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,t.unpackAlignment);let y=F.getParameter(F.UNPACK_ROW_LENGTH),b=F.getParameter(F.UNPACK_IMAGE_HEIGHT),x=F.getParameter(F.UNPACK_SKIP_PIXELS),S=F.getParameter(F.UNPACK_SKIP_ROWS),C=F.getParameter(F.UNPACK_SKIP_IMAGES);F.pixelStorei(F.UNPACK_ROW_LENGTH,h.width),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,h.height),F.pixelStorei(F.UNPACK_SKIP_PIXELS,l),F.pixelStorei(F.UNPACK_SKIP_ROWS,u),F.pixelStorei(F.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=L.get(e),r=L.get(t),h=L.get(n.__renderTarget),g=L.get(r.__renderTarget);I.bindFramebuffer(F.READ_FRAMEBUFFER,h.__webglFramebuffer),I.bindFramebuffer(F.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n{e.delete(t)},n=()=>{e.clear()},r=n=>{e.add(n);let r=()=>t(n);return Pk(r),{off:r}},i=(...t)=>Promise.all(Array.from(e).map(e=>e(...t)));return{on:r,off:t,trigger:i,clear:n}}const Ik=new WeakMap,Lk=(...e)=>{var t;let n=e[0],r=(t=Ao())?.proxy;if(r==null&&!Qi())throw Error(`injectLocal must be called in setup`);return r&&Ik.has(r)&&n in Ik.get(r)?Ik.get(r)[n]:Zi(...e)},Rk=typeof window<`u`&&typeof document<`u`,zk=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,Bk=e=>e!==void 0,Vk=e=>e!=null,Hk=Object.prototype.toString,Uk=e=>Hk.call(e)===`[object Object]`,Wk=()=>{};function Gk(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function Kk(e,t={}){let n,r,i=Wk,a=e=>{clearTimeout(e),i(),i=Wk},o,s=s=>{let c=B(e),l=B(t.maxWait);return n&&a(n),c<=0||l!==void 0&&l<=0?(r&&(a(r),r=null),Promise.resolve(s())):new Promise((e,u)=>{i=t.rejectOnCancel?u:e,o=s,l&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,e(o())},l)),n=setTimeout(()=>{r&&a(r),r=null,e(s())},c)})};return s}function qk(e){let t=Object.create(null);return n=>{let r=t[n];return r||(t[n]=e(n))}}const Jk=/\B([A-Z])/g,Yk=qk(e=>e.replace(Jk,`-$1`).toLowerCase()),Xk=/-(\w)/g,Zk=qk(e=>e.replace(Xk,(e,t)=>t?t.toUpperCase():``));function Qk(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function $k(e,t,n=!1){return t.reduce((t,r)=>(r in e&&(!n||e[r]!==void 0)&&(t[r]=e[r]),t),{})}function eA(e){return e||Ao()}function tA(e){return Array.isArray(e)?e:[e]}function nA(e,t=200,n={}){return Gk(Kk(t,n),e)}function rA(e,t=200,n={}){let r=R(e.value),i=nA(()=>{r.value=e.value},t,n);return V(e,()=>i()),r}function iA(e,t={}){if(!pn(e))return Sn(e);let n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let r in e.value)n[r]=xn(()=>({get(){return e.value[r]},set(n){var i;let a=(i=B(t.replaceRef))??!0;if(a)if(Array.isArray(e.value)){let t=[...e.value];t[r]=n,e.value=t}else{let t={...e.value,[r]:n};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}else e.value[r]=n}}));return n}const aA=B;function oA(e,t=!0,n){let r=eA();r?$r(e,n):t?e():Kn(e)}function sA(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=null,o=z(!1);function s(){a&&(clearInterval(a),a=null)}function c(){o.value=!1,s()}function l(){let n=B(t);n<=0||(o.value=!0,i&&e(),s(),o.value&&(a=setInterval(e,n)))}if(r&&Rk&&l(),pn(t)||typeof t==`function`){let e=V(t,()=>{o.value&&Rk&&l()});Pk(e)}return Pk(c),{isActive:o,pause:c,resume:l}}function cA(e,t,n){return V(e,t,{...n,immediate:!0})}const lA=Rk?window:void 0,uA=Rk?window.document:void 0,dA=Rk?window.navigator:void 0,fA=Rk?window.location:void 0;function pA(e){var t;let n=B(e);return(t=n?.$el)??n}function mA(...e){let t=[],n=()=>{t.forEach(e=>e()),t.length=0},r=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),i=H(()=>{let t=tA(B(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=cA(()=>{var t,n;return[(n=(t=i.value)?.map(e=>pA(e)))??[lA].filter(e=>e!=null),tA(B(i.value?e[1]:e[0])),tA(_n(i.value?e[2]:e[1])),B(i.value?e[3]:e[2])]},([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=Uk(o)?{...o}:o;t.push(...e.flatMap(e=>i.flatMap(t=>a.map(n=>r(e,t,n,s)))))},{flush:`post`}),o=()=>{a(),n()};return Pk(n),o}function hA(){let e=z(!1),t=Ao();return t&&$r(()=>{e.value=!0},t),e}function gA(e){let t=hA();return H(()=>(t.value,!!e()))}function _A(e,t,n={}){let{window:r=lA,...i}=n,a,o=gA(()=>r&&`MutationObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=H(()=>{let t=B(e),n=tA(t).map(pA).filter(Vk);return new Set(n)}),l=V(()=>c.value,e=>{s(),o.value&&e.size&&(a=new MutationObserver(t),e.forEach(e=>a.observe(e,i)))},{immediate:!0,flush:`post`}),u=()=>a?.takeRecords(),d=()=>{l(),s()};return Pk(d),{isSupported:o,stop:d,takeRecords:u}}function vA(e,t={}){let{immediate:n=!0,fpsLimit:r=void 0,window:i=lA,once:a=!1}=t,o=z(!1),s=H(()=>r?1e3/B(r):null),c=0,l=null;function u(t){if(!o.value||!i)return;c||=t;let n=t-c;if(s.value&&nn&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=z(typeof r==`number`),o=z(),s=z(!1),c=e=>{s.value=e.matches};return Aa(()=>{if(a.value){a.value=!i.value;let t=B(e).split(`,`);s.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=Qk(n[1])),i&&a&&(a=r<=Qk(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(B(e)),s.value=o.value.matches)}),mA(o,`change`,c,{passive:!0}),H(()=>s.value)}function SA(e){return JSON.parse(JSON.stringify(e))}function CA(e={}){let{window:t=lA}=e,n=z(1),r=xA(()=>`(resolution: ${n.value}dppx)`,e),i=Wk;return t&&(i=cA(r,()=>n.value=t.devicePixelRatio)),{pixelRatio:tn(n),stop:i}}function wA(e,t,n={}){let{window:r=lA,...i}=n,a,o=gA(()=>r&&`ResizeObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=H(()=>{let t=B(e);return Array.isArray(t)?t.map(e=>pA(e)):[pA(t)]}),l=V(c,e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),u=()=>{s(),l()};return Pk(u),{isSupported:o,stop:u}}function TA(e,t={}){let{reset:n=!0,windowResize:r=!0,windowScroll:i=!0,immediate:a=!0,updateTiming:o=`sync`}=t,s=z(0),c=z(0),l=z(0),u=z(0),d=z(0),f=z(0),p=z(0),m=z(0);function h(){let t=pA(e);if(!t){n&&(s.value=0,c.value=0,l.value=0,u.value=0,d.value=0,f.value=0,p.value=0,m.value=0);return}let r=t.getBoundingClientRect();s.value=r.height,c.value=r.bottom,l.value=r.left,u.value=r.right,d.value=r.top,f.value=r.width,p.value=r.x,m.value=r.y}function g(){o===`sync`?h():o===`next-frame`&&requestAnimationFrame(()=>h())}return wA(e,g),V(()=>pA(e),e=>!e&&g()),_A(e,g,{attributeFilter:[`style`,`class`]}),i&&mA(`scroll`,g,{capture:!0,passive:!0}),r&&mA(`resize`,g,{passive:!0}),oA(()=>{a&&g()}),{height:s,bottom:c,left:l,right:u,top:d,width:f,x:p,y:m,update:g}}function EA(e,t={width:0,height:0},n={}){let{window:r=lA,box:i=`content-box`}=n,a=H(()=>{var t,n;return(n=(t=pA(e))?.namespaceURI)?.includes(`svg`)}),o=z(t.width),s=z(t.height),{stop:c}=wA(e,([t])=>{let n=i===`border-box`?t.borderBoxSize:i===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(r&&a.value){let t=pA(e);if(t){let e=t.getBoundingClientRect();o.value=e.width,s.value=e.height}}else if(n){let e=tA(n);o.value=e.reduce((e,{inlineSize:t})=>e+t,0),s.value=e.reduce((e,{blockSize:t})=>e+t,0)}else o.value=t.contentRect.width,s.value=t.contentRect.height},n);oA(()=>{let n=pA(e);n&&(o.value=`offsetWidth`in n?n.offsetWidth:t.width,s.value=`offsetHeight`in n?n.offsetHeight:t.height)});let l=V(()=>pA(e),e=>{o.value=e?t.width:0,s.value=e?t.height:0});function u(){c(),l()}return{width:o,height:s,stop:u}}function DA(e){var t;let n=z(0);if(typeof performance>`u`)return n;let r=(t=e?.every)??10,i=performance.now(),a=0;return vA(()=>{if(a+=1,a>=r){let e=performance.now(),t=e-i;n.value=Math.round(1e3/(t/a)),i=e,a=0}}),n}function OA(e={}){let t=R(),n=gA(()=>typeof performance<`u`&&`memory`in performance);if(n.value){let{interval:n=1e3}=e;sA(()=>{t.value=performance.memory},n,{immediate:e.immediate,immediateCallback:e.immediateCallback})}return{isSupported:n,memory:t}}const kA={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},AA=Object.keys(kA);function jA(e={}){let{target:t=lA}=e,n=z(!1),r=R(e.initialValue||{});Object.assign(r.value,kA,r.value);let i=t=>{n.value=!0,!(e.pointerTypes&&!e.pointerTypes.includes(t.pointerType))&&(r.value=$k(t,AA,!1))};if(t){let e={passive:!0};mA(t,[`pointerdown`,`pointermove`,`pointerup`],i,e),mA(t,`pointerleave`,()=>n.value=!1,e)}return{...iA(r),isInside:n}}const MA=[{max:6e4,value:1e3,name:`second`},{max:276e4,value:6e4,name:`minute`},{max:72e6,value:36e5,name:`hour`},{max:5184e5,value:864e5,name:`day`},{max:24192e5,value:6048e5,name:`week`},{max:28512e6,value:2592e6,name:`month`},{max:1/0,value:31536e6,name:`year`}];function NA(e,t,n,r={}){var i,a,o;let{clone:s=!1,passive:c=!1,eventName:l,deep:u=!1,defaultValue:d,shouldEmit:f}=r,p=Ao(),m=n||p?.emit||(i=p?.$emit)?.bind(p)||(o=(a=p?.proxy)?.$emit)?.bind(p?.proxy),h=l;t||=`modelValue`,h||=`update:${t.toString()}`;let g=e=>s?typeof s==`function`?s(e):SA(e):e,_=()=>Bk(e[t])?g(e[t]):d,v=e=>{f?f(e)&&m(h,e):m(h,e)};if(c){let n=_(),r=R(n),i=!1;return V(()=>e[t],e=>{i||(i=!0,r.value=g(e),Kn(()=>i=!1))}),V(r,n=>{!i&&(n!==e[t]||u)&&v(n)},{deep:u}),r}else return H({get(){return _()},set(e){v(e)}})}function PA(e={}){let{window:t=lA,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:i=!0,includeScrollbar:a=!0,type:o=`inner`}=e,s=z(n),c=z(r),l=()=>{if(t)if(o===`outer`)s.value=t.outerWidth,c.value=t.outerHeight;else if(o===`visual`&&t.visualViewport){let{width:e,height:n,scale:r}=t.visualViewport;s.value=Math.round(e*r),c.value=Math.round(n*r)}else a?(s.value=t.innerWidth,c.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,c.value=t.document.documentElement.clientHeight)};l(),oA(l);let u={passive:!0};if(mA(`resize`,l,u),t&&o===`visual`&&t.visualViewport&&mA(t.visualViewport,`resize`,l,u),i){let e=xA(`(orientation: portrait)`);V(e,()=>l())}return{width:s,height:c}}var FA=Object.defineProperty,IA=(e,t,n)=>t in e?FA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LA=(e,t,n)=>IA(e,typeof t==`symbol`?t:t+``,n);const RA=`@tresjs/core`,zA=`module`,BA=`4.3.6`,VA=`pnpm@10.6.3`,HA=`Declarative ThreeJS using Vue Components`,UA=`Alvaro Saburido (https://github.com/alvarosabu/)`,WA=`MIT`,GA={type:`git`,url:`git+https://github.com/Tresjs/tres.git`},KA=[`vue`,`3d`,`threejs`,`three`,`threejs-vue`],qA=!1,JA={".":{types:`./dist/index.d.ts`,import:`./dist/tres.js`,require:`./dist/tres.umd.cjs`},"./components":{types:`./dist/src/components/index.d.ts`},"./composables":{types:`./dist/src/composables/index.d.ts`},"./types":{types:`./dist/src/types/index.d.ts`},"./utils":{types:`./dist/src/utils/index.d.ts`},"./*":`./*`},YA=`./dist/tres.js`,XA=`./dist/tres.js`,ZA=`./dist/index.d.ts`,QA=[`*.d.ts`,`dist`],$A={access:`public`},ej={dev:`pnpm --filter='./playground/vue' dev`,"dev:nuxt":`pnpm --filter='./playground/nuxt' dev`,build:`vite build`,test:`vitest`,"test:ci":`vitest run`,"test:ui":`vitest --ui --coverage.enabled=true`,release:`release-it`,coverage:`vitest run --coverage`,lint:`eslint .`,"lint:fix":`eslint . --fix`,"docs:dev":`vitepress dev docs`,"docs:build":`vitepress build docs`,"docs:serve":`vitepress serve docs`,"docs:preview":`vitepress preview docs`,"docs:contributors":`esno scripts/update-contributors.ts`},tj={three:`>=0.133`,vue:`>=3.4`},nj={"@alvarosabu/utils":`^3.2.0`,"@vue/devtools-api":`^6.6.3`,"@vueuse/core":`^12.5.0`},rj={"@release-it/conventional-changelog":`^10.0.0`,"@stackblitz/sdk":`^1.11.0`,"@tresjs/cientos":`4.1.0`,"@tresjs/eslint-config":`^1.4.0`,"@types/three":`^0.173.0`,"@typescript-eslint/eslint-plugin":`^8.23.0`,"@typescript-eslint/parser":`^8.23.0`,"@vitejs/plugin-vue":`^5.2.1`,"@vitest/coverage-c8":`^0.33.0`,"@vitest/coverage-v8":`^3.0.5`,"@vitest/ui":`^3.0.5`,"@vue/test-utils":`^2.4.6`,eslint:`^9.19.0`,"eslint-plugin-vue":`^9.32.0`,esno:`^4.8.0`,gsap:`^3.12.7`,jsdom:`^26.0.0`,kolorist:`^1.8.0`,ohmyfetch:`^0.4.21`,pathe:`^2.0.2`,"release-it":`^18.1.2`,"rollup-plugin-analyzer":`^4.0.0`,"rollup-plugin-copy":`^3.5.0`,"rollup-plugin-visualizer":`^5.14.0`,sponsorkit:`^16.3.0`,three:`^0.173.0`,unocss:`^65.4.3`,unplugin:`^2.1.2`,"unplugin-vue-components":`^28.0.0`,vite:`^6.1.0`,"vite-plugin-banner":`^0.8.0`,"vite-plugin-dts":`4.5.0`,"vite-plugin-inspect":`^10.1.0`,"vite-plugin-require-transform":`^1.0.21`,"vite-svg-loader":`^5.1.0`,vitepress:`1.6.3`,vitest:`3.0.5`,vue:`3.5.13`,"vue-demi":`^0.14.10`},ij={name:RA,type:zA,version:BA,packageManager:VA,description:HA,author:UA,license:WA,repository:GA,keywords:KA,sideEffects:qA,exports:JA,main:YA,module:XA,types:ZA,files:QA,publishConfig:$A,scripts:ej,peerDependencies:tj,dependencies:nj,devDependencies:rj};function aj(e){let t={nodes:{},materials:{}};return e&&e.traverse(e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material)}),t}async function oj(e,t,n,r,i){let{logError:a}=hM(),o=new e;return i&&i(o),n&&n(o),await new Promise((e,n)=>{o.load(t,t=>{let n=t;n.scene&&Object.assign(n,aj(n.scene)),e(n)},r,e=>{a(`[useLoader] - Failed to load resource`,e),n(e)})})}var sj=class extends Eg{constructor(...e){super(...e),LA(this,`type`,`HightlightMesh`),LA(this,`createTime`),this.createTime=Date.now()}onBeforeRender(){let e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}};function cj(e){return typeof e>`u`}function lj(e){return Array.isArray(e)}function uj(e){return typeof e==`number`}function dj(e){return typeof e==`string`}function fj(e){return typeof e==`function`}function pj(e){return e===Object(e)&&!lj(e)&&!fj(e)}function mj(e){return pj(e)&&!!e.isObject3D}function hj(e){return pj(e)&&!!e.isColor}function gj(e){return e!=null&&(typeof e==`string`||typeof e==`number`||hj(e))}function _j(e){return typeof e==`object`&&!!e&&`set`in e&&typeof e.set==`function`}function vj(e){return _j(e)&&`copy`in e&&typeof e.copy==`function`}function yj(e){return!!(e!=null&&e.constructor)}function bj(e){return e instanceof ah}function xj(e){return pj(e)&&!!e.isCamera}function Sj(e){return pj(e)&&!!e.isBufferGeometry}function Cj(e){return pj(e)&&!!e.isMaterial}function wj(e){return pj(e)&&!!e.isLight}function Tj(e){return pj(e)&&!!e.isFog}function Ej(e){return pj(e)&&!!e.isScene}function Dj(e){return mj(e)||Sj(e)||Cj(e)||Tj(e)}function Oj(e){return pj(e)&&!!e.isPrimitive}const kj=(e,t)=>{for(let n of Object.keys(t))t[n]instanceof Object&&Object.assign(t[n],kj(e[n],t[n]));return Object.assign(e||{},t),e},Aj=`html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot`,jj=Ij(Aj);function Mj(e){return e&&e.nodeType===1}function Nj(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const Pj=/\B([A-Z])/g;function Fj(e){return e.replace(Pj,`-$1`).toLowerCase()}function Ij(e,t){let n=Object.create(null),r=e.split(`,`);for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}const Lj=(e,t)=>{if(!t)return;let n=Array.isArray(t)?t:t.match(/([^[.\]])+/g);return n?.reduce((e,t)=>e&&e[t],e)},Rj=(e,t,n)=>{let r=Array.isArray(t)?t:t.match(/([^[.\]])+/g);r&&r.reduce((e,t,i)=>(e[t]===void 0&&(e[t]={}),i===r.length-1&&(e[t]=n),e[t]),e)};function zj(e,t){if(Mj(e)&&Mj(t)){let n=e.attributes,r=t.attributes;return n.length===r.length?Array.from(n).every(({name:e,value:n})=>t.getAttribute(e)===n):!1}if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!zj(e[i],t[i]))return!1;return!0}function Bj(e,t){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{if(e.uuid===t)return e;for(let t of e.children){let e=i(t);if(e)return e}},a=i(e);if(!a){console.warn(`Object with UUID not found in the scene.`);return}let o=a;for(let e=0;eKj(e)),!(e instanceof $g)){let t=e;e&&((n=e.dispose)==null||n.call(e)),t.geometry&&t.geometry.dispose(),Array.isArray(t.material)?t.material.forEach(e=>Gj(e)):t.material&&Gj(t.material)}}function qj(e,t){let n=0;for(let r=0;rt===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(``)}const Xj=/-\d+$/;function Zj(e,t,n){if(dj(n)){if(Xj.test(n)){let t=n.replace(Xj,``),{target:r,key:i}=Jj(e,t);if(!Array.isArray(r[i])){let e=r[i],t=[];t.__tresDetach=()=>{t.every(e=>cj(e))&&(r[i]=e)},r[i]=t}}let{target:r,key:i}=Jj(e,n);t.__tres.previousAttach=r[i],r[i]=rM(t)}else t.__tres.previousAttach=n(e,t)}function Qj(e,t,n){var r,i,a;if(dj(n)){let{target:r,key:i}=Jj(e,n),a=t.__tres.previousAttach;a===void 0?delete r[i]:r[i]=a,`__tresDetach`in r&&r.__tresDetach()}else (i=(r=t.__tres)?.previousAttach)==null||i.call(r,e,t);(a=t.__tres)==null||delete a.previousAttach}function $j(e,t,n){let r=e;return r.__tres={type:`unknown`,eventCount:0,root:n,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...t},r.__tres.attach||(r.isMaterial?r.__tres.attach=`material`:r.isBufferGeometry?r.__tres.attach=`geometry`:r.isFog&&(r.__tres.attach=`fog`)),r}function eM(e){var t;let n=(t=e?.__tres)?.root;n&&n.render&&n.render.canBeInvalidated.value&&n.invalidate()}function tM(e,t,n){var r;if(!fj(e.setPixelRatio))return;let i=0;if(n&&lj(n)&&n.length>=2){let[e,r]=n;i=zp.clamp(t,e,r)}else i=uj(n)?n:t;i!==(r=e.getPixelRatio)?.call(e)&&e.setPixelRatio(i)}function nM(e,t,n,r,i){let a=[...t.__tres.objects],o=rM(t);if(e=rM(e),o===e)return!0;let s=$j(e,t.__tres??{},i),c=t.parent??t.__tres.parent??null,l={...t.__tres.memoizedProps};delete l.object;for(let e of a)iM(e,i),aM(e,i);o.__tres.objects=[],r.remove(t);for(let[e,t]of Object.entries(l))r.patchProp(s,e,s[e],t);n(e),r.insert(t,c);for(let e of a)r.insert(e,t);return!0}function rM(e){return Oj(e)?(e.object.__tres=e.__tres,e.object):e}function iM(e,t){var n,r,i,a;let o=(n=e.__tres)?.parent||t.scene.value;e.__tres&&(e.__tres.parent=null),o&&o.__tres&&`objects`in o.__tres&&qj(o.__tres.objects,t=>t!==e),(r=e.__tres)!=null&&r.attach?Qj(o,e,e.__tres.attach):((a=(i=e.parent)?.remove)==null||a.call(i,rM(e)),e.parent=null)}function aM(e,t){var n;(n=e.traverse)==null||n.call(e,e=>{var n;t.deregisterCamera(e),(n=t.eventManager)==null||n.deregisterPointerMissedObject(e)}),t.deregisterCamera(e),eM(e)}async function oM(e,t){let n=new jx(t),r=e=>new Promise((t,r)=>{n.load(e,e=>t(e),()=>null,()=>{r(Error(`[useTextures] - Failed to load texture`))})});if(Vj(e)){let t=await Promise.all(e.map(e=>r(e)));return e.length>1?t:t[0]}else{let{map:t,displacementMap:n,normalMap:i,roughnessMap:a,metalnessMap:o,aoMap:s,alphaMap:c,matcap:l}=e;return{map:t?await r(t):null,displacementMap:n?await r(n):null,normalMap:i?await r(i):null,roughnessMap:a?await r(a):null,metalnessMap:o?await r(o):null,aoMap:s?await r(s):null,alphaMap:c?await r(c):null,matcap:l?await r(l):null}}}const sM=Rr({__name:`component`,props:{map:{},displacementMap:{},normalMap:{},roughnessMap:{},metalnessMap:{},aoMap:{},alphaMap:{},matcap:{}},async setup(e){let t,n,r=e,i=([t,n]=Ai(()=>$t(oM(r))),t=await t,n(),t);return(e,t)=>_i(e.$slots,`default`,{textures:_n(i)})}}),cM=({sizes:e})=>{let t=R([]),n=H(()=>t.value[0]),r=e=>{let n=e instanceof Rg?e:t.value.find(t=>t.uuid===e);if(!n)return;let r=t.value.filter(({uuid:e})=>e!==n.uuid);t.value=[n,...r]},i=(e,n=!1)=>{if(xj(e)){let i=e;if(t.value.some(({uuid:e})=>e===i.uuid))return;n?r(i):t.value.push(i)}},a=e=>{if(xj(e)){let n=e;t.value=t.value.filter(({uuid:e})=>e!==n.uuid)}};return Aa(()=>{e.aspectRatio.value&&t.value.forEach(t=>{!t.manual&&(t instanceof Hg||lM(t))&&(t instanceof Hg?t.aspect=e.aspectRatio.value:(t.left=e.width.value*-.5,t.right=e.width.value*.5,t.top=e.height.value*.5,t.bottom=e.height.value*-.5),t.updateProjectionMatrix())})}),ri(()=>{t.value=[]}),{camera:n,cameras:t,registerCamera:i,deregisterCamera:a,setCameraActive:r}};function lM(e){return e.hasOwnProperty(`isOrthographicCamera`)&&e.isOrthographicCamera}const uM=!0,dM=`[TresJS ▲ ■ ●] `;function fM(...e){typeof e[0]==`string`?e[0]=dM+e[0]:e.unshift(dM),console.error(...e)}function pM(...e){typeof e[0]==`string`?e[0]=dM+e[0]:e.unshift(dM),console.warn(...e)}function mM(e,t){}function hM(){return{logError:fM,logWarning:pM,logMessage:mM}}const gM=R({}),_M=e=>Object.assign(gM.value,e);function vM(){let e=new Map,t=new Set,n=0,r=!1,i=()=>{let n=Array.from(e.entries()).sort((e,t)=>{let n=e[1].priority-t[1].priority;return n===0?e[1].addI-t[1].addI:n});t.clear(),n.forEach(e=>t.add(e[0]))},a=n=>{e.delete(n),t.delete(n)};return{on:(t,i=0)=>{e.set(t,{priority:i,addI:n++});let o=()=>a(t);return Pk(o),r=!0,{off:o}},off:a,trigger:(...e)=>{r&&(i(),r=!1),t.forEach(t=>t(...e))},dispose:()=>{e.clear(),t.clear()},get count(){return e.size}}}function yM(){let e=!0,t=!0,n=!1,r=new gS(!1),i=R(r.running),a=R(!1),o,s=zp.generateUUID(),c=null,l=vM(),u=vM(),d=vM();S();let f={};function p(e){f=e}function m(e,t,n=0){switch(t){case`before`:return l.on(e,n);case`render`:return c||=e,u.dispose(),u.on(e);case`after`:return d.on(e,n)}}function h(){t&&(t=!1,S(),x())}function g(){t=!0,S(),cancelAnimationFrame(o)}function _(){n=!1,S()}function v(){n=!0,S()}function y(){a.value=!0}function b(){a.value=!1}function x(){if(!e){o=requestAnimationFrame(x);return}let t=r.getDelta(),n=r.getElapsedTime(),s={camera:_n(f.camera),scene:_n(f.scene),renderer:_n(f.renderer),raycaster:_n(f.raycaster),controls:_n(f.controls),invalidate:f.invalidate,advance:f.advance},p={delta:t,elapsed:n,clock:r,...s};i.value&&l.trigger(p),a.value||(u.count?u.trigger(p):c&&c(p)),i.value&&d.trigger(p),o=requestAnimationFrame(x)}function S(){let e=!t&&!n;r.running!==e&&(r.running?r.stop():r.start()),i.value=r.running}return{loopId:s,register:(e,t,n)=>m(e,t,n),start:h,stop:g,pause:v,resume:_,pauseRender:y,resumeRender:b,isRenderPaused:a,isActive:i,setContext:p,setReady:t=>e=t}}function bM(e){let t=0;return e.traverse(e=>{if(e.isMesh&&e.geometry&&e.type!==`HightlightMesh`){let n=e.geometry,r=n.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,i=n.index?n.index.count*Uint32Array.BYTES_PER_ELEMENT:0,a=n.attributes.normal?n.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,o=n.attributes.uv?n.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,s=r+i+a+o;t+=s}}),t}function xM(e){return(e/1024).toFixed(2)}const SM=Number.parseInt(El.replace(`dev`,``));function CM(e){return e instanceof K?e:Array.isArray(e)?new K(...e):new K(e)}const wM={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:Sf,toneMapping:Du,toneMappingExposure:3,shadowMap:{enabled:!0,type:Fl}},flat:{toneMapping:Cu,toneMappingExposure:1}};function TM({canvas:e,options:t,contextParts:{sizes:n,render:r,invalidate:i,advance:a}}){let o=H(()=>({alpha:aA(t.alpha)??!0,depth:aA(t.depth),canvas:pA(e),context:aA(t.context),stencil:aA(t.stencil),antialias:aA(t.antialias)??!0,precision:aA(t.precision),powerPreference:aA(t.powerPreference),premultipliedAlpha:aA(t.premultipliedAlpha),preserveDrawingBuffer:aA(t.preserveDrawingBuffer),logarithmicDepthBuffer:aA(t.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:aA(t.failIfMajorPerformanceCaveat)})),s=z(new Nk(o.value));function c(){t.renderMode===`on-demand`&&i()}V(o,()=>{s.value.dispose(),s.value=new Nk(o.value),c()}),V([n.width,n.height],()=>{s.value.setSize(n.width.value,n.height.value),c()},{immediate:!0}),V(()=>t.clearColor,c);let{pixelRatio:l}=CA(),{logError:u}=hM(),d=(()=>{let e=new Nk,t={shadowMap:{enabled:e.shadowMap.enabled,type:e.shadowMap.type},toneMapping:e.toneMapping,toneMappingExposure:e.toneMappingExposure,outputColorSpace:e.outputColorSpace};return e.dispose(),t})(),f=aA(t.renderMode);return f===`on-demand`&&i(),f===`manual`&&setTimeout(()=>{a()},100),Aa(()=>{let e=aA(t.preset);e&&(e in wM||u(`Renderer Preset must be one of these: ${Object.keys(wM).join(`, `)}`),kj(s.value,wM[e])),tM(s.value,l.value,aA(t.dpr)),f===`always`&&(r.frames.value=Math.max(1,r.frames.value));let n=(t,n)=>{let r=aA(t),i=()=>{if(e)return Lj(wM[e],n)};if(r!==void 0)return r;let a=i();return a===void 0?Lj(d,n):a},i=(e,t)=>Rj(s.value,t,n(e,t));i(t.shadows,`shadowMap.enabled`),i(t.toneMapping??Du,`toneMapping`),i(t.shadowMapType,`shadowMap.type`),SM<150&&i(!t.useLegacyLights,`physicallyCorrectLights`),i(t.outputColorSpace,`outputColorSpace`),i(t.toneMappingExposure,`toneMappingExposure`);let a=n(t.clearColor,`clearColor`);a&&s.value.setClearColor(a?CM(a):new K(0))}),ri(()=>{s.value.dispose(),s.value.forceContextLoss()}),{renderer:s}}function EM(e,t,n=10){let r=aA(e)?PA():EA(H(()=>aA(t).parentElement)),i=tn(rA(r.width,n)),a=tn(rA(r.height,n)),o=H(()=>i.value/a.value);return{height:a,width:i,aspectRatio:o}}const DM=(e,t)=>{let n=H(()=>t.renderer.value.domElement),r=z([]),{x:i,y:a}=jA({target:n}),o=0,{width:s,height:c,top:l,left:u}=TA(n),d=({x:e,y:t})=>{if(n.value)return{x:(e-u.value)/s.value*2-1,y:-((t-l.value)/c.value)*2+1}},f=({x:n,y:i})=>{if(t.camera.value)return t.raycaster.value.setFromCamera(new U(n,i),t.camera.value),r.value=t.raycaster.value.intersectObjects(e.value,!0),r.value},p=e=>{let t=d({x:e?.clientX??i.value,y:e?.clientY??a.value});return t&&f(t)||[]},m=Fk(),h=Fk(),g=Fk(),_=Fk(),v=Fk(),y=Fk(),b=Fk(),x=Fk();function S(e){let t={};for(let n in e)typeof n!=`function`&&(t[n]=e[n]);return t}let C=(e,n)=>{var i,a,s;let c=S(n),l=new W(n?.clientX,n?.clientY,0).unproject((i=t.camera)?.value);e.trigger({...c,intersections:r.value,unprojectedPoint:l,ray:(a=t.raycaster)?.value.ray,camera:(s=t.camera)?.value,sourceEvent:n,delta:o,stopPropagating:!1})},w,T=e=>{p(e),C(g,e),w=e},E=()=>{w&&T(w)},D,O,k,A=e=>{var t;D=(t=r.value[0])?.object,o=0,O=new U(e?.clientX??i.value,e?.clientY??a.value),C(v,e)},j,M=!1,N=e=>{var t,n,s;e instanceof PointerEvent&&(r.value.length===0&&C(y,e),D===(t=r.value[0])?.object&&(k=new U(e?.clientX??i.value,e?.clientY??a.value),o=O?.distanceTo(k),e.button===0?(C(m,e),j===(n=r.value[0])?.object?M=!0:(j=(s=r.value[0])?.object,M=!1)):e.button===2&&C(b,e)),C(_,e))},ee=e=>{M&&(C(h,e),j=void 0,M=!1)},te=e=>C(g,e),P=e=>C(x,e);return n.value.addEventListener(`pointerup`,N),n.value.addEventListener(`pointerdown`,A),n.value.addEventListener(`pointermove`,T),n.value.addEventListener(`pointerleave`,te),n.value.addEventListener(`dblclick`,ee),n.value.addEventListener(`wheel`,P),ri(()=>{n!=null&&n.value&&(n.value.removeEventListener(`pointerup`,N),n.value.removeEventListener(`pointerdown`,A),n.value.removeEventListener(`pointermove`,T),n.value.removeEventListener(`pointerleave`,te),n.value.removeEventListener(`dblclick`,ee),n.value.removeEventListener(`wheel`,P))}),{intersects:r,onClick:e=>m.on(e).off,onDblClick:e=>h.on(e).off,onContextMenu:e=>b.on(e).off,onPointerMove:e=>g.on(e).off,onPointerUp:e=>_.on(e).off,onPointerDown:e=>v.on(e).off,onPointerMissed:e=>y.on(e).off,onWheel:e=>x.on(e).off,forceUpdate:E}};function OM(e,t){if(Array.isArray(e))for(let n of e)n(t);typeof e==`function`&&e(t)}function kM(e,t,n){var r;let i=z(),a=z();e&&(i.value=e),t&&(a.value=t);let o=e=>{var t;return(t=e.__tres)?.eventCount>0},s=e=>{var t;return(t=e.children)?.some(e=>s(e))||o(e)},c=z(((r=i.value)?.children).filter(s)||[]);function l(e,t){let r=[],i=()=>t.stopPropagating=!0;t.stopPropagation=i;for(let i of t?.intersections){if(t.stopPropagating)return;t={...t,...i};let{object:a}=i;t.eventObject=a,OM(a[e],t),r.push(a);let o=a.parent;for(;o!==null&&!t.stopPropagating&&!r.includes(o);)t.eventObject=o,OM(o[e],t),r.push(o),o=o.parent;let s=Fj(e.slice(2));n(s,{intersection:i,event:t})}}let{onClick:u,onDblClick:d,onContextMenu:f,onPointerMove:p,onPointerDown:m,onPointerUp:h,onPointerMissed:g,onWheel:_,forceUpdate:v}=DM(c,t);h(e=>l(`onPointerUp`,e)),m(e=>l(`onPointerDown`,e)),u(e=>l(`onClick`,e)),d(e=>l(`onDoubleClick`,e)),f(e=>l(`onContextMenu`,e)),_(e=>l(`onWheel`,e));let y=[];p(e=>{let t=e.intersections.map(({object:e})=>e),n=e.intersections;y.forEach(({object:n})=>{t.includes(n)||(e.intersections=y,l(`onPointerLeave`,e),l(`onPointerOut`,e))}),e.intersections=n,e.intersections.forEach(({object:t})=>{y.includes(t)||(l(`onPointerEnter`,e),l(`onPointerOver`,e))}),l(`onPointerMove`,e),y=e.intersections});let b=[];g(e=>{let t=()=>e.stopPropagating=!0;e.stopPropagation=t,b.forEach(t=>{e.stopPropagating||(e.eventObject=t,OM(t.onPointerMissed,e))}),n(`pointer-missed`,{event:e})});function x(e){Dj(e)&&mj(e)&&c.value.push(e)}function S(e){if(Dj(e)&&mj(e)){let t=c.value.indexOf(e);t>-1&&c.value.splice(t,1)}}function C(e){Dj(e)&&mj(e)&&e.onPointerMissed&&b.push(e)}function w(e){if(Dj(e)&&mj(e)){let t=b.indexOf(e);t>-1&&b.splice(t,1)}}return t.eventManager={forceUpdate:v,registerObject:x,deregisterObject:S,registerPointerMissedObject:C,deregisterPointerMissedObject:w},{forceUpdate:v,registerObject:x,deregisterObject:S,registerPointerMissedObject:C,deregisterPointerMissedObject:w}}function AM(e,t,n=100){n=n<=0?100:n;let r=Fk(),i=new Set,a=!1,o=!1,s=null;function c(){s&&clearTimeout(s),!o&&!a&&e()?(r.trigger(t),i.forEach(e=>e()),i.clear(),a=!0):!o&&!a&&(s=setTimeout(c,n))}function l(){o=!0,s&&clearTimeout(s)}c();let u=(e,...t)=>{e(...t)};return{on:e=>{if(a)return u(e,t),{off:()=>{}};{let t=r.on(e);return i.add(t.off),r.on(e)}},off:r.off,trigger:r.trigger,clear:r.clear,cancel:l}}const jM=new WeakMap;function MM(e){if(e||=PM(),jM.has(e))return jM.get(e);let t=100,n=Date.now(),r=AM(()=>{if(Date.now()-n>=t)return!0;{let t=e.renderer.value,n=t?.domElement||{width:0,height:0};return!!(t&&n.width>0&&n.height>0)}},e);return jM.set(e,r),r}function NM({scene:e,canvas:t,windowSize:n,rendererOptions:r,emit:i}){let a=z(e),o=EM(n,t),{camera:s,cameras:c,registerCamera:l,deregisterCamera:u,setCameraActive:d}=cM({sizes:o}),f={mode:R(r.renderMode||`always`),priority:R(0),frames:R(0),maxFrames:60,canBeInvalidated:H(()=>f.mode.value===`on-demand`&&f.frames.value===0)};function p(e=1){r.renderMode===`on-demand`&&(f.frames.value=Math.min(f.maxFrames,f.frames.value+e))}function m(){r.renderMode===`manual`&&(f.frames.value=1)}let{renderer:h}=TM({canvas:t,options:r,contextParts:{sizes:o,render:f,invalidate:p,advance:m}}),g={sizes:o,scene:a,camera:s,cameras:tn(c),renderer:h,raycaster:z(new tC),controls:R(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:f,advance:m,extend:_M,invalidate:p,registerCamera:l,setCameraActive:d,deregisterCamera:u,loop:yM()};Xi(`useTres`,g),g.scene.value.__tres={root:g},g.loop.register(()=>{s.value&&f.frames.value>0&&(h.value.render(e,s.value),i(`render`,g.renderer.value)),f.priority.value=0,f.mode.value===`always`?f.frames.value=1:f.frames.value=Math.max(0,f.frames.value-1)},`render`);let{on:_,cancel:v}=MM(g);g.loop.setReady(!1),g.loop.start(),_(()=>{i(`ready`,g),g.loop.setReady(!0),kM(e,g,i)}),ri(()=>{v(),g.loop.stop()});let y=100,b=DA({every:y}),{isSupported:x,memory:S}=OA({interval:y}),C=160,w=performance.now(),T=({timestamp:e})=>{g.scene.value&&(g.perf.memory.allocatedMem=bM(g.scene.value)),e-w>=y&&(w=e,g.perf.fps.accumulator.push(b.value),g.perf.fps.accumulator.length>C&&g.perf.fps.accumulator.shift(),g.perf.fps.value=b.value,x.value&&S.value&&(g.perf.memory.accumulator.push(S.value.usedJSHeapSize/1024/1024),g.perf.memory.accumulator.length>C&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce((e,t)=>e+t,0)/g.perf.memory.accumulator.length))},E=0,D=1,{pause:O}=vA(({delta:e})=>{window.__TRES__DEVTOOLS__&&(T({timestamp:performance.now()}),E+=e,E>=D&&(window.__TRES__DEVTOOLS__.cb(g),E=0))},{immediate:!0});return ri(()=>{O()}),g}function PM(){let e=Zi(`useTres`);if(!e)throw Error(`useTresContext must be used together with useTresContextProvider`);return e}const FM=PM;function IM(){let{camera:e,scene:t,renderer:n,loop:r,raycaster:i,controls:a,invalidate:o,advance:s}=PM();r.setContext({camera:e,scene:t,renderer:n,raycaster:i,controls:a,invalidate:o,advance:s});function c(e,t=0){return r.register(e,`before`,t)}function l(e){return r.register(e,`render`)}function u(e,t=0){return r.register(e,`after`,t)}return{pause:r.pause,resume:r.resume,pauseRender:r.pauseRender,resumeRender:r.resumeRender,isActive:r.isActive,onBeforeRender:c,render:l,onAfterRender:u}}const LM=Fk(),RM=Fk(),zM=Fk(),BM=new gS;let VM=0,HM=0;const{pause:UM,resume:WM,isActive:GM}=vA(()=>{LM.trigger({delta:VM,elapsed:HM,clock:BM}),RM.trigger({delta:VM,elapsed:HM,clock:BM}),zM.trigger({delta:VM,elapsed:HM,clock:BM})},{immediate:!1});zM.on(()=>{VM=BM.getDelta(),HM=BM.getElapsedTime()});function KM(e,t={},n={}){let r=e,i=e=>{r=e},a=new Proxy({},{}),o={has(e,n){return n in t||n in r},get(e,n,i){return n in t?t[n](r):r[n]},set(e,t,o){return n[t]?n[t](o,r,a,i):r[t]=o,!0}};return a=new Proxy({},o),a}const{logError:qM}=hM(),JM=[`onClick`,`onContextMenu`,`onPointerMove`,`onPointerEnter`,`onPointerLeave`,`onPointerOver`,`onPointerOut`,`onDoubleClick`,`onPointerDown`,`onPointerUp`,`onPointerCancel`,`onPointerMissed`,`onLostPointerCapture`,`onWheel`],YM=e=>{let t=e.scene.value;function n(t,n,o,s){if(s||={},s.args||=[],t===`template`||jj(t))return null;let c=t.replace(`Tres`,``),l;if(t===`primitive`){(!pj(s.object)||pn(s.object))&&qM(`Tres primitives need an 'object' prop, whose value is an object or shallowRef`),c=s.object.type;let t={};l=KM(s.object,{object:e=>e,isPrimitive:()=>!0,__tres:()=>t},{object:(t,n,o,s)=>{nM(t,o,s,{patchProp:a,remove:i,insert:r},e)},__tres:e=>{Object.assign(t,e)}})}else{let e=gM.value[c];e||qM(`${c} is not defined on the THREE namespace. Use extend to add it to the catalog.`),l=new e(...s.args)}return l?(l.isCamera&&(s!=null&&s.position||l.position.set(3,3,3),s!=null&&s.lookAt||l.lookAt(0,0,0)),l=$j(l,{...l.__tres,type:c,memoizedProps:s,eventCount:0,primitive:t===`primitive`,attach:s.attach},e),l):null}function r(n,r){var i,a,o;if(!n)return;r||=t;let s=n.__tres?n:$j(n,{},e),c=r.__tres?r:$j(r,{},e);n=rM(s),r=rM(c),n.__tres&&(i=n.__tres)?.eventCount>0&&((a=e.eventManager)==null||a.registerObject(n)),e.registerCamera(n),(o=e.eventManager)==null||o.registerPointerMissedObject(n),s.__tres.attach?Zj(c,s,s.__tres.attach):mj(n)&&mj(c)&&(c.add(n),n.dispatchEvent({type:`added`})),s.__tres.parent=c,c.__tres.objects&&!c.__tres.objects.includes(s)&&c.__tres.objects.push(s)}function i(t,n){var r,a,o,s;if(!t)return;t!=null&&t.__tres&&(r=t.__tres)?.eventCount>0&&((a=e.eventManager)==null||a.deregisterObject(t)),n=cj(n)?`default`:n;let c=(o=t.__tres)?.dispose;cj(c)||(n=c===null?!1:c);let l=(s=t.__tres)?.primitive,u=n===`default`?!l:!!n;if(t.__tres&&`objects`in t.__tres&&[...t.__tres.objects].forEach(e=>i(e,n)),u&&t.children&&[...t.children].forEach(e=>i(e,n)),iM(t,e),aM(t,e),u&&!Ej(t)){if(fj(n))n(t);else if(fj(t.dispose))try{t.dispose()}catch{}}`__tres`in t&&delete t.__tres}function a(t,n,a,o){var s,c;if(!t)return;let l=t,u=n;if(t.__tres&&(t.__tres.memoizedProps[n]=o),n===`attach`){let n=(s=t.__tres)?.parent||t.parent;i(t),$j(t,{attach:o},e),n&&r(t,n);return}if(n===`dispose`){t.__tres||(t=$j(t,{},e)),t.__tres.dispose=o;return}if(mj(t)&&u===`blocks-pointer-events`){o||o===``?t[u]=o:delete t[u];return}JM.includes(n)&&t.__tres&&(t.__tres.eventCount+=1);let d=Nj(u),f=l?.[d];if(u===`args`){let e=t,n=a??[],r=o??[],i=(c=t.__tres)?.type||t.type;i&&n.length&&!Bj(n,r)&&(l=Object.assign(e,new gM.value[i](...o)));return}if(l.type===`BufferGeometry`){if(u===`args`)return;l.setAttribute(Nj(u),new Qh(...o));return}if(u.includes(`-`)&&f===void 0){f=l;for(let e of u.split(`-`))d=u=Nj(e),l=f,f=f?.[u]}let p=o;if(p===``&&(p=!0),fj(f)){JM.includes(n)||(lj(p)?t[d](...p):t[d](p)),d.startsWith(`on`)&&fj(p)&&(l[d]=p);return}bj(f)&&bj(p)?f.mask=p.mask:hj(f)&&gj(p)?f.set(p):vj(f)&&yj(p)&&f.constructor===p.constructor?f.copy(p):_j(f)&&Array.isArray(p)?`fromArray`in f&&typeof f.fromArray==`function`?f.fromArray(p):f.set(...p):_j(f)&&typeof p==`number`?`setScalar`in f&&typeof f.setScalar==`function`?f.setScalar(p):f.set(p):l[d]=p,eM(t)}function o(e){var t;return(t=e?.__tres)?.parent||null}function s(t){let n=$j(new xh,{type:`Comment`},e);return n.name=t,n}function c(e){var t;let n=o(e),r=(t=n?.__tres)?.objects||[],i=r.indexOf(e);return i<0||i>=r.length-1?null:r[i+1]}return{insert:r,remove:i,createElement:n,patchProp:a,parentNode:o,createText:()=>void 0,createComment:s,setText:()=>void 0,setElementText:()=>void 0,nextSibling:c,querySelector:()=>void 0,setScopeId:()=>void 0,cloneNode:()=>void 0,insertStaticContent:()=>void 0}};function XM(){return ZM().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ZM(){return typeof navigator<`u`&&typeof window<`u`?window:typeof globalThis<`u`?globalThis:{}}const QM=typeof Proxy==`function`,$M=`devtools-plugin:setup`,eN=`plugin:settings:set`;let tN,nN;function rN(){var e;return tN!==void 0||(typeof window<`u`&&window.performance?(tN=!0,nN=window.performance):typeof globalThis<`u`&&(e=globalThis.perf_hooks)!=null&&e.performance?(tN=!0,nN=globalThis.perf_hooks.performance):tN=!1),tN}function iN(){return rN()?nN.now():Date.now()}var aN=class{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;let n={};if(e.settings)for(let t in e.settings){let r=e.settings[t];n[t]=r.defaultValue}let r=`__vue-devtools-plugin-settings__${e.id}`,i=Object.assign({},n);try{let e=localStorage.getItem(r),t=JSON.parse(e);Object.assign(i,t)}catch{}this.fallbacks={getSettings(){return i},setSettings(e){try{localStorage.setItem(r,JSON.stringify(e))}catch{}i=e},now(){return iN()}},t&&t.on(eN,(e,t)=>{e===this.plugin.id&&this.fallbacks.setSettings(t)}),this.proxiedOn=new Proxy({},{get:(e,t)=>this.target?this.target.on[t]:(...e)=>{this.onQueue.push({method:t,args:e})}}),this.proxiedTarget=new Proxy({},{get:(e,t)=>this.target?this.target[t]:t===`on`?this.proxiedOn:Object.keys(this.fallbacks).includes(t)?(...e)=>(this.targetQueue.push({method:t,args:e,resolve:()=>{}}),this.fallbacks[t](...e)):(...e)=>new Promise(n=>{this.targetQueue.push({method:t,args:e,resolve:n})})})}async setRealTarget(e){this.target=e;for(let e of this.onQueue)this.target.on[e.method](...e.args);for(let e of this.targetQueue)e.resolve(await this.target[e.method](...e.args))}};function oN(e,t){let n=e,r=ZM(),i=XM(),a=QM&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))i.emit($M,e,t);else{let e=a?new aN(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:e}),e&&t(e.proxiedTarget)}}function sN(e,t){let n=`▲ ■ ●${e}`;typeof cN==`function`?cN(n,t):console.log(n)}function cN(e,t){throw Error(e+t)}const lN=e=>{let t={id:e.uuid,label:e.type,children:[],tags:[]};e.name!==``&&t.tags.push({label:e.name,textColor:5750629,backgroundColor:15793395});let n=bM(e);return n>0&&t.tags.push({label:`${xM(n)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:`Memory usage`}),e.type.includes(`Light`)&&(wj(e)&&t.tags.push({label:`${e.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:`Intensity`}),t.tags.push({label:`#${new K(e.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:`Color`})),e.type.includes(`Camera`)&&(t.tags.push({label:`${e.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:`Field of view`}),t.tags.push({label:`x: ${Math.round(e.position.x)} y: ${Math.round(e.position.y)} z: ${Math.round(e.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:`Position`})),t};function uN(e,t,n=``){e.children.forEach(e=>{if(e.type===`HightlightMesh`||n&&!e.type.includes(n)&&!e.name.includes(n))return;let r=lN(e);t.children.push(r),uN(e,r,n)})}const dN=[],fN=`tres:inspector`,pN=$t({sceneGraph:null});function mN(e,t){oN({id:`dev.esm.tres`,label:`TresJS 🪐`,logo:`https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg`,packageName:`tresjs`,homepage:`https://tresjs.org`,componentStateTypes:dN,app:e},e=>{typeof e.now!=`function`&&sN(`You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.`),e.addInspector({id:fN,label:`TresJS 🪐`,icon:`account_tree`,treeFilterPlaceholder:`Search instances`}),setInterval(()=>{e.sendInspectorTree(fN)},1e3),setInterval(()=>{e.notifyComponentUpdate()},5e3),e.on.getInspectorTree(e=>{if(e.inspectorId===fN){let n=lN(t.scene.value);uN(t.scene.value,n,e.filter),pN.sceneGraph=n,e.rootNodes=[n]}});let n=null,r=null;e.on.getInspectorState(e=>{var i;if(e.inspectorId===fN){let[a]=t.scene.value.getObjectsByProperty(`uuid`,e.nodeId);if(!a)return;if(r&&n&&n.parent&&r.remove(n),a.isMesh){let e=Uj(a);a.add(e),n=e,r=a}e.state={object:Object.entries(a).map(([e,t])=>e===`children`?{key:e,value:t.filter(e=>e.type!==`HightlightMesh`)}:{key:e,value:t,editable:!0}).filter(({key:e})=>e!==`parent`)},a.isScene&&(e.state={...e.state,state:[{key:`Scene Info`,value:{objects:a.children.length,memory:bM(a),calls:t.renderer.value.info.render.calls,triangles:t.renderer.value.info.render.triangles,points:t.renderer.value.info.render.points,lines:t.renderer.value.info.render.lines}},{key:`Programs`,value:(i=t.renderer.value.info.programs)?.map(e=>({...e,programName:e.name}))||[]}]})}}),e.on.editInspectorState(e=>{e.inspectorId===fN&&Hj(t.scene.value,e.nodeId,e.path,e.state.value)})})}const hN=[`data-scene`,`data-tres`],gN=Rr({__name:`TresCanvas`,props:{shadows:{type:Boolean,default:void 0},clearColor:{},toneMapping:{},shadowMapType:{},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:`always`},dpr:{},camera:{},preset:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},context:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},antialias:{type:Boolean,default:void 0},stencil:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},depth:{type:Boolean,default:void 0},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},reverseDepthBuffer:{type:Boolean}},emits:[`render`,`click`,`double-click`,`context-menu`,`pointer-move`,`pointer-up`,`pointer-down`,`pointer-enter`,`pointer-leave`,`pointer-over`,`pointer-out`,`pointer-missed`,`wheel`,`ready`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=wi(),o=R(),s=z(new $g),c=Ao();_M(ZC);let l=(e,t=!1)=>Rr({setup(){var n;let i=(n=Ao())?.appContext;i&&(i.app=c?.appContext.app);let o={};function s(e){e&&(e.parent&&s(e.parent),e.provides&&Object.assign(o,e.provides))}return c!=null&&c.parent&&r.enableProvideBridge&&(s(c.parent),Reflect.ownKeys(o).forEach(e=>{Xi(e,o[e])})),Xi(`useTres`,e),Xi(`extend`,_M),typeof window<`u`&&mN(i?.app,e),()=>Jo(Ya,null,t?[]:a.default())}}),u=(e,t=!1)=>{let n=l(e,t),{render:r}=ya(YM(e));r(Jo(n),s.value)},d=(e,t=!1)=>{Kj(e.scene.value),t&&(e.renderer.value.dispose(),e.renderer.value.renderLists.dispose(),e.renderer.value.forceContextLoss()),s.value.__tres={root:e}},f=z(null);t({context:f,dispose:()=>d(f.value,!0)});let p=()=>{d(f.value),u(f.value,!0)};return $r(()=>{let e=o;f.value=NM({scene:s.value,canvas:e,windowSize:r.windowSize??!1,rendererOptions:r,emit:i});let{registerCamera:t,camera:n,cameras:a,deregisterCamera:c}=f.value;u(f.value);let l=()=>{let e=new Hg(45,window.innerWidth/window.innerHeight,.1,1e3);e.position.set(3,3,3),e.lookAt(0,0,0),t(e);let n=Aa(()=>{a.value.length>=2&&(e.removeFromParent(),c(e),n?.())})};V(()=>r.camera,(e,n)=>{e&&t(e),n&&(n.removeFromParent(),c(n))},{immediate:!0}),n.value||l()}),ri(p),(e,t)=>(to(),oo(`canvas`,{ref_key:`canvas`,ref:o,"data-scene":s.value.uuid,class:Se(e.$attrs.class),"data-tres":`tresjs ${_n(ij).version}`,style:L({display:`block`,width:`100%`,height:`100%`,position:e.windowSize?`fixed`:`relative`,top:0,left:0,pointerEvents:`auto`,touchAction:`none`,...e.$attrs.style})},null,14,hN))}}),_N=[`TresCanvas`,`TresLeches`,`TresScene`],vN={template:{compilerOptions:{isCustomElement:e=>e.startsWith(`Tres`)&&!_N.includes(e)||e===`primitive`}}},{logWarning:yN}=hM();var bN=class extends kv{constructor(e,t){let n=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new mg;r.setAttribute(`position`,new q(n,3)),r.computeBoundingSphere();let i=new xv({fog:!1});super(r,i),this.light=e,this.color=t,this.type=`RectAreaLightHelper`;let a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],o=new mg;o.setAttribute(`position`,new q(a,3)),o.computeBoundingSphere(),this.add(new Eg(o,new Uh({side:Rl,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);let e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}};const{logWarning:xN}=hM();let SN,CN;const wN={DirectionalLight:kC,PointLight:yC,SpotLight:pC,HemisphereLight:CC,RectAreaLight:bN},TN={mounted:e=>{if(!e.isLight){xN(`${e.type} is not a light`);return}SN=wN[e.type],e.parent.add(new SN(e,1,e.color.getHex()))},updated:e=>{CN=e.parent.children.find(e=>e instanceof SN),!(CN instanceof bN)&&CN.update()},unmounted:e=>{if(!e.isLight){xN(`${e.type} is not a light`);return}CN=e.parent.children.find(e=>e instanceof SN),CN&&CN.dispose&&CN.dispose(),e.parent&&e.parent.remove(CN)}},EN={mounted:(e,t)=>{if(t.arg){console.log(`v-log:${t.arg}`,e[t.arg]);return}console.log(`v-log`,e)}},DN={install(e){e.component(`TresCanvas`,gN)}};function ON(e){if(typeof e!=`object`||!e)return!1;let 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 kN(e,t,n=`.`,r){if(!ON(t))return kN(e,{},n,r);let i=Object.assign({},t);for(let t in e){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];if(a==null||r&&r(i,t,a,n))continue;Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:ON(a)&&ON(i[t])?i[t]=kN(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a}return i}function AN(e){return(...t)=>t.reduce((t,n)=>kN(t,n,``,e),{})}const jN=AN(),MN=AN((e,t,n)=>{if(e[t]!==void 0&&typeof n==`function`)return e[t]=n(e[t]),!0}),NN=AN((e,t,n)=>{if(Array.isArray(e[t])&&typeof n==`function`)return e[t]=n(e[t]),!0});function PN(e){return ze()?(Be(e),!0):!1}function FN(){let e=new Set,t=t=>{e.delete(t)},n=()=>{e.clear()},r=n=>{e.add(n);let r=()=>t(n);return PN(r),{off:r}},i=(...t)=>Promise.all(Array.from(e).map(e=>e(...t)));return{on:r,off:t,trigger:i,clear:n}}const IN=new WeakMap,LN=(...e)=>{var t;let n=e[0],r=(t=Ao())?.proxy;if(r==null&&!Qi())throw Error(`injectLocal must be called in setup`);return r&&IN.has(r)&&n in IN.get(r)?IN.get(r)[n]:Zi(...e)},RN=typeof window<`u`&&typeof document<`u`,zN=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,BN=e=>e!=null,VN=Object.prototype.toString,HN=e=>VN.call(e)===`[object Object]`,UN=()=>{},WN=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function GN(...e){if(e.length!==1)return Tn(...e);let t=e[0];return typeof t==`function`?tn(xn(()=>({get:t,set:UN}))):R(t)}function KN(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}const qN=e=>e();function JN(e,t={}){let n,r,i=UN,a=e=>{clearTimeout(e),i(),i=UN},o,s=s=>{let c=B(e),l=B(t.maxWait);return n&&a(n),c<=0||l!==void 0&&l<=0?(r&&(a(r),r=void 0),Promise.resolve(s())):new Promise((e,u)=>{i=t.rejectOnCancel?u:e,o=s,l&&!r&&(r=setTimeout(()=>{n&&a(n),r=void 0,e(o())},l)),n=setTimeout(()=>{r&&a(r),r=void 0,e(s())},c)})};return s}function YN(...e){let t=0,n,r=!0,i=UN,a,o,s,c,l;!pn(e[0])&&typeof e[0]==`object`?{delay:o,trailing:s=!0,leading:c=!0,rejectOnCancel:l=!1}=e[0]:[o,s=!0,c=!0,l=!1]=e;let u=()=>{n&&(clearTimeout(n),n=void 0,i(),i=UN)},d=e=>{let d=B(o),f=Date.now()-t,p=()=>a=e();return u(),d<=0?(t=Date.now(),p()):(f>d&&(c||!r)?(t=Date.now(),p()):s&&(a=new Promise((e,a)=>{i=l?a:e,n=setTimeout(()=>{t=Date.now(),r=!0,e(p()),u()},Math.max(0,d-f))})),!c&&!n&&(n=setTimeout(()=>r=!0,d)),r=!1,a)};return d}function XN(e=qN,t={}){let{initialState:n=`active`}=t,r=GN(n===`active`);function i(){r.value=!1}function a(){r.value=!0}let o=(...t)=>{r.value&&e(...t)};return{isActive:tn(r),pause:i,resume:a,eventFilter:o}}function ZN(e){let t;function n(){return t||=e(),t}return n.reset=async()=>{let e=t;t=void 0,e&&await e},n}function QN(e,t){var n;if(typeof e==`number`)return e+t;let r=(n=e.match(/^-?\d+\.?\d*/))?.[0]||``,i=e.slice(r.length),a=Number.parseFloat(r)+t;return Number.isNaN(a)?e:a+i}function $N(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function eP(e){return Array.isArray(e)?e:[e]}function tP(e){let t=Object.create(null);return n=>{let r=t[n];return r||(t[n]=e(n))}}const nP=/\B([A-Z])/g,rP=tP(e=>e.replace(nP,`-$1`).toLowerCase()),iP=/-(\w)/g,aP=tP(e=>e.replace(iP,(e,t)=>t?t.toUpperCase():``));function oP(e){return e||Ao()}function sP(e,t=200,n={}){return KN(JN(t,n),e)}function cP(e,t=200,n={}){let r=R(B(e)),i=sP(()=>{r.value=e.value},t,n);return V(e,()=>i()),nn(r)}function lP(e,t=200,n=!1,r=!0,i=!1){return KN(YN(t,n,r,i),e)}function uP(e,t,n={}){let{eventFilter:r=qN,...i}=n;return V(e,KN(r,t),i)}function dP(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=XN(r,{initialState:i}),u=uP(e,t,{...a,eventFilter:o});return{stop:u,pause:s,resume:c,isActive:l}}function fP(e,t=!0,n){let r=oP(n);r?$r(e,n):t?e():Kn(e)}function pP(e,t){let n=oP(t);n&&ri(e,t)}function mP(e,t,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=z(!1),o;function s(){o&&(clearTimeout(o),o=void 0)}function c(){a.value=!1,s()}function l(...n){i&&e(),s(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=void 0,e(...n)},B(t))}return r&&(a.value=!0,RN&&l()),PN(c),{isPending:nn(a),start:l,stop:c}}function hP(e,t,n={}){let{debounce:r=0,maxWait:i=void 0,...a}=n;return uP(e,t,{...a,eventFilter:JN(r,{maxWait:i})})}function gP(e,t,n){return V(e,t,{...n,immediate:!0})}function _P(e,t,n){let r;r=pn(n)?{evaluating:n}:n||{};let{lazy:i=!1,flush:a=`pre`,evaluating:o=void 0,shallow:s=!0,onError:c=UN}=r,l=z(!i),u=s?z(t):R(t),d=0;return Aa(async t=>{if(!l.value)return;d++;let n=d,r=!1;o&&Promise.resolve().then(()=>{o.value=!0});try{let i=await e(e=>{t(()=>{o&&(o.value=!1),r||e()})});n===d&&(u.value=i)}catch(e){c(e)}finally{o&&n===d&&(o.value=!1),r=!0}},{flush:a}),i?H(()=>(l.value=!0,u.value)):u}const vP=RN?window:void 0,yP=RN?window.document:void 0,bP=RN?window.navigator:void 0,xP=RN?window.location:void 0;function SP(e){var t;let n=B(e);return(t=n?.$el)??n}function CP(...e){let t=[],n=()=>{t.forEach(e=>e()),t.length=0},r=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),i=H(()=>{let t=eP(B(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=gP(()=>{var t,n;return[(n=(t=i.value)?.map(e=>SP(e)))??[vP].filter(e=>e!=null),eP(B(i.value?e[1]:e[0])),eP(_n(i.value?e[2]:e[1])),B(i.value?e[3]:e[2])]},([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=HN(o)?{...o}:o;t.push(...e.flatMap(e=>i.flatMap(t=>a.map(n=>r(e,t,n,s)))))},{flush:`post`}),o=()=>{a(),n()};return PN(n),o}function wP(){let e=z(!1),t=Ao();return t&&$r(()=>{e.value=!0},t),e}function TP(e){let t=wP();return H(()=>(t.value,!!e()))}function EP(e,t,n={}){let{window:r=vP,...i}=n,a,o=TP(()=>r&&`MutationObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=H(()=>{let t=B(e),n=eP(t).map(SP).filter(BN);return new Set(n)}),l=V(()=>c.value,e=>{s(),o.value&&e.size&&(a=new MutationObserver(t),e.forEach(e=>a.observe(e,i)))},{immediate:!0,flush:`post`}),u=()=>a?.takeRecords(),d=()=>{l(),s()};return PN(d),{isSupported:o,stop:d,takeRecords:u}}const DP=Symbol(`vueuse-ssr-width`);function OP(){let e=Qi()?LN(DP,null):null;return typeof e==`number`?e:void 0}function kP(e,t={}){let{window:n=vP,ssrWidth:r=OP()}=t,i=TP(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=z(typeof r==`number`),o=z(),s=z(!1),c=e=>{s.value=e.matches};return Aa(()=>{if(a.value){a.value=!i.value;let t=B(e).split(`,`);s.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=$N(n[1])),i&&a&&(a=r<=$N(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(B(e)),s.value=o.value.matches)}),CP(o,`change`,c,{passive:!0}),H(()=>s.value)}const AP={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function jP(e,t={}){function n(t,n){let r=B(e[B(t)]);return n!=null&&(r=QN(r,n)),typeof r==`number`&&(r=`${r}px`),r}let{window:r=vP,strategy:i=`min-width`,ssrWidth:a=OP()}=t,o=typeof a==`number`,s=o?z(!1):{value:!0};o&&fP(()=>s.value=!!r);function c(e,t){return!s.value&&o?e===`min`?a>=$N(t):a<=$N(t):r?r.matchMedia(`(${e}-width: ${t})`).matches:!1}let l=e=>kP(()=>`(min-width: ${n(e)})`,t),u=e=>kP(()=>`(max-width: ${n(e)})`,t),d=Object.keys(e).reduce((e,t)=>(Object.defineProperty(e,t,{get:()=>i===`min-width`?l(t):u(t),enumerable:!0,configurable:!0}),e),{});function f(){let t=Object.keys(e).map(e=>[e,d[e],$N(n(e))]).sort((e,t)=>e[2]-t[2]);return H(()=>t.filter(([,e])=>e.value).map(([e])=>e))}return Object.assign(d,{greaterOrEqual:l,smallerOrEqual:u,greater(e){return kP(()=>`(min-width: ${n(e,.1)})`,t)},smaller(e){return kP(()=>`(max-width: ${n(e,-.1)})`,t)},between(e,r){return kP(()=>`(min-width: ${n(e)}) and (max-width: ${n(r,-.1)})`,t)},isGreater(e){return c(`min`,n(e,.1))},isGreaterOrEqual(e){return c(`min`,n(e))},isSmaller(e){return c(`max`,n(e,-.1))},isSmallerOrEqual(e){return c(`max`,n(e))},isInBetween(e,t){return c(`min`,n(e))&&c(`max`,n(t,-.1))},current:f,active(){let e=f();return H(()=>e.value.length===0?``:e.value.at(i===`min-width`?-1:0))}})}function MP(e,t={}){let{controls:n=!1,navigator:r=bP}=t,i=TP(()=>r&&`permissions`in r),a=z(),o=typeof e==`string`?{name:e}:e,s=z(),c=()=>{var e,t;s.value=(t=(e=a.value)?.state)??`prompt`};CP(a,`change`,c,{passive:!0});let l=ZN(async()=>{if(i.value){if(!a.value)try{a.value=await r.permissions.query(o)}catch{a.value=void 0}finally{c()}if(n)return ln(a.value)}});return l(),n?{state:s,isSupported:i,query:l}:s}function NP(e={}){let{navigator:t=bP,read:n=!1,source:r,copiedDuring:i=1500,legacy:a=!1}=e,o=TP(()=>t&&`clipboard`in t),s=MP(`clipboard-read`),c=MP(`clipboard-write`),l=H(()=>o.value||a),u=z(``),d=z(!1),f=mP(()=>d.value=!1,i,{immediate:!1});async function p(){let e=!(o.value&&_(s.value));if(!e)try{u.value=await t.clipboard.readText()}catch{e=!0}e&&(u.value=g())}l.value&&n&&CP([`copy`,`cut`],p,{passive:!0});async function m(e=B(r)){if(l.value&&e!=null){let n=!(o.value&&_(c.value));if(!n)try{await t.clipboard.writeText(e)}catch{n=!0}n&&h(e),u.value=e,d.value=!0,f.start()}}function h(e){let t=document.createElement(`textarea`);t.value=e??``,t.style.position=`absolute`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()}function g(){var e,t,n;return(n=(t=(e=document==null?void 0:document.getSelection)?.call(document))?.toString())??``}function _(e){return e===`granted`||e===`prompt`}return{isSupported:l,text:u,copied:d,copy:m}}const PP=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},FP=`__vueuse_ssr_handlers__`,IP=LP();function LP(){return FP in PP||(PP[FP]=PP[FP]||{}),PP[FP]}function RP(e,t){return IP[e]||t}function zP(e){return kP(`(prefers-color-scheme: dark)`,e)}function BP(e){return e==null?`any`:e instanceof Set?`set`:e instanceof Map?`map`:e instanceof Date?`date`:typeof e==`boolean`?`boolean`:typeof e==`string`?`string`:typeof e==`object`?`object`:Number.isNaN(e)?`any`:`number`}const VP={boolean:{read:e=>e===`true`,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},HP=`vueuse-storage`;function UP(e,t,n,r={}){var i;let{flush:a=`pre`,deep:o=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:l=!1,shallow:u,window:d=vP,eventFilter:f,onError:p=e=>{console.error(e)},initOnMounted:m}=r,h=(u?z:R)(typeof t==`function`?t():t),g=H(()=>B(e));if(!n)try{n=RP(`getDefaultStorage`,()=>{var e;return(e=vP)?.localStorage})()}catch(e){p(e)}if(!n)return h;let _=B(t),v=BP(_),y=(i=r.serializer)??VP[v],{pause:b,resume:x}=dP(h,()=>E(h.value),{flush:a,deep:o,eventFilter:f});V(g,()=>O(),{flush:a});let S=!1,C=e=>{m&&!S||O(e)},w=e=>{m&&!S||k(e)};d&&s&&(n instanceof Storage?CP(d,`storage`,C,{passive:!0}):CP(d,HP,w)),m?fP(()=>{S=!0,O()}):O();function T(e,t){if(d){let r={key:g.value,oldValue:e,newValue:t,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent(`storage`,r):new CustomEvent(HP,{detail:r}))}}function E(e){try{let t=n.getItem(g.value);if(e==null)T(t,null),n.removeItem(g.value);else{let r=y.write(e);t!==r&&(n.setItem(g.value,r),T(t,r))}}catch(e){p(e)}}function D(e){let t=e?e.newValue:n.getItem(g.value);if(t==null)return c&&_!=null&&n.setItem(g.value,y.write(_)),_;if(!e&&l){let e=y.read(t);return typeof l==`function`?l(e,_):v===`object`&&!Array.isArray(e)?{..._,...e}:e}else if(typeof t!=`string`)return t;else return y.read(t)}function O(e){if(!(e&&e.storageArea!==n)){if(e&&e.key==null){h.value=_;return}if(!(e&&e.key!==g.value)){b();try{e?.newValue!==y.write(h.value)&&(h.value=D(e))}catch(e){p(e)}finally{e?Kn(x):x()}}}}function k(e){O(e.detail)}return h}const WP=`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function GP(e={}){let{selector:t=`html`,attribute:n=`class`,initialValue:r=`auto`,window:i=vP,storage:a,storageKey:o=`vueuse-color-scheme`,listenToStorageChanges:s=!0,storageRef:c,emitAuto:l,disableTransition:u=!0}=e,d={auto:``,light:`light`,dark:`dark`,...e.modes||{}},f=zP({window:i}),p=H(()=>f.value?`dark`:`light`),m=c||(o==null?GN(r):UP(o,r,a,{window:i,listenToStorageChanges:s})),h=H(()=>m.value===`auto`?p.value:m.value),g=RP(`updateHTMLAttrs`,(e,t,n)=>{let r=typeof e==`string`?i?.document.querySelector(e):SP(e);if(!r)return;let a=new Set,o=new Set,s=null;if(t===`class`){let e=n.split(/\s/g);Object.values(d).flatMap(e=>(e||``).split(/\s/g)).filter(Boolean).forEach(t=>{e.includes(t)?a.add(t):o.add(t)})}else s={key:t,value:n};if(a.size===0&&o.size===0&&s===null)return;let c;u&&(c=i.document.createElement(`style`),c.appendChild(document.createTextNode(WP)),i.document.head.appendChild(c));for(let e of a)r.classList.add(e);for(let e of o)r.classList.remove(e);s&&r.setAttribute(s.key,s.value),u&&(i.getComputedStyle(c).opacity,document.head.removeChild(c))});function _(e){var r;g(t,n,(r=d[e])??e)}function v(t){e.onChanged?e.onChanged(t,_):_(t)}V(h,v,{flush:`post`,immediate:!0}),fP(()=>v(h.value));let y=H({get(){return l?m.value:h.value},set(e){m.value=e}});return Object.assign(y,{store:m,system:p,state:h})}function KP(e,t,n={}){let{window:r=vP,initialValue:i,observe:a=!1}=n,o=z(i),s=H(()=>{var e;return SP(t)||(e=r?.document)?.documentElement});function c(){var t;let n=B(e),a=B(s);if(a&&r&&n){let e=(t=r.getComputedStyle(a).getPropertyValue(n))?.trim();o.value=e||o.value||i}}return a&&EP(s,c,{attributeFilter:[`style`,`class`],window:r}),V([s,()=>B(e)],(e,t)=>{t[0]&&t[1]&&t[0].style.removeProperty(t[1]),c()},{immediate:!0}),V([o,s],([t,n])=>{let r=B(e);n?.style&&r&&(t==null?n.style.removeProperty(r):n.style.setProperty(r,t))},{immediate:!0}),o}function qP(e={}){let{valueDark:t=`dark`,valueLight:n=``}=e,r=GP({...e,onChanged:(t,n)=>{var r;e.onChanged?(r=e.onChanged)==null||r.call(e,t===`dark`,n,t):n(t)},modes:{dark:t,light:n}}),i=H(()=>r.system.value),a=H({get(){return r.value===`dark`},set(e){let t=e?`dark`:`light`;i.value===t?r.value=`auto`:r.value=t}});return a}function JP(e={}){let{navigator:t=bP,requestPermissions:n=!1,constraints:r={audio:!0,video:!0},onUpdated:i}=e,a=R([]),o=H(()=>a.value.filter(e=>e.kind===`videoinput`)),s=H(()=>a.value.filter(e=>e.kind===`audioinput`)),c=H(()=>a.value.filter(e=>e.kind===`audiooutput`)),l=TP(()=>t&&t.mediaDevices&&t.mediaDevices.enumerateDevices),u=z(!1),d;async function f(){l.value&&(a.value=await t.mediaDevices.enumerateDevices(),i?.(a.value),d&&(d.getTracks().forEach(e=>e.stop()),d=null))}async function p(){let e=r.video?`camera`:`microphone`;if(!l.value)return!1;if(u.value)return!0;let{state:n,query:i}=MP(e,{controls:!0});if(await i(),n.value!==`granted`){let e=!0;try{let e=await t.mediaDevices.enumerateDevices(),n=e.some(e=>e.kind===`videoinput`),i=e.some(e=>e.kind===`audioinput`||e.kind===`audiooutput`);r.video=n?r.video:!1,r.audio=i?r.audio:!1,d=await t.mediaDevices.getUserMedia(r)}catch{d=null,e=!1}f(),u.value=e}else u.value=!0;return u.value}return l.value&&(n&&p(),CP(t.mediaDevices,`devicechange`,f,{passive:!0}),f()),{devices:a,ensurePermissions:p,permissionGranted:u,videoInputs:o,audioInputs:s,audioOutputs:c,isSupported:l}}function YP(e,t,n={}){let{window:r=vP,...i}=n,a,o=TP(()=>r&&`ResizeObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=H(()=>{let t=B(e);return Array.isArray(t)?t.map(e=>SP(e)):[SP(t)]}),l=V(c,e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),u=()=>{s(),l()};return PN(u),{isSupported:o,stop:u}}function XP(e,t={}){let{reset:n=!0,windowResize:r=!0,windowScroll:i=!0,immediate:a=!0,updateTiming:o=`sync`}=t,s=z(0),c=z(0),l=z(0),u=z(0),d=z(0),f=z(0),p=z(0),m=z(0);function h(){let t=SP(e);if(!t){n&&(s.value=0,c.value=0,l.value=0,u.value=0,d.value=0,f.value=0,p.value=0,m.value=0);return}let r=t.getBoundingClientRect();s.value=r.height,c.value=r.bottom,l.value=r.left,u.value=r.right,d.value=r.top,f.value=r.width,p.value=r.x,m.value=r.y}function g(){o===`sync`?h():o===`next-frame`&&requestAnimationFrame(()=>h())}return YP(e,g),V(()=>SP(e),e=>!e&&g()),EP(e,g,{attributeFilter:[`style`,`class`]}),i&&CP(`scroll`,g,{capture:!0,passive:!0}),r&&CP(`resize`,g,{passive:!0}),fP(()=>{a&&g()}),{height:s,bottom:c,left:l,right:u,top:d,width:f,x:p,y:m,update:g}}function ZP(e,t,n={}){let{root:r,rootMargin:i=`0px`,threshold:a=0,window:o=vP,immediate:s=!0}=n,c=TP(()=>o&&`IntersectionObserver`in o),l=H(()=>{let t=B(e);return eP(t).map(SP).filter(BN)}),u=UN,d=z(s),f=c.value?V(()=>[l.value,SP(r),d.value],([e,n])=>{if(u(),!d.value||!e.length)return;let r=new IntersectionObserver(t,{root:SP(n),rootMargin:i,threshold:a});e.forEach(e=>e&&r.observe(e)),u=()=>{r.disconnect(),u=UN}},{immediate:s,flush:`post`}):UN,p=()=>{u(),f(),d.value=!1};return PN(p),{isSupported:c,isActive:d,pause(){u(),d.value=!1},resume(){d.value=!0},stop:p}}const QP={multiple:!0,accept:`*`,reset:!1,directory:!1};function $P(e){if(!e)return null;if(e instanceof FileList)return e;let t=new DataTransfer;for(let n of e)t.items.add(n);return t.files}function eF(e={}){let{document:t=yP}=e,n=R($P(e.initialFiles)),{on:r,trigger:i}=FN(),{on:a,trigger:o}=FN(),s;t&&(s=SP(e.input)||t.createElement(`input`),s.type=`file`,s.onchange=e=>{let t=e.target;n.value=t.files,i(n.value)},s.oncancel=()=>{o()});let c=()=>{n.value=null,s&&s.value&&(s.value=``,i(null))},l=t=>{if(!s)return;let n={...QP,...e,...t};s.multiple=n.multiple,s.accept=n.accept,s.webkitdirectory=n.directory,WN(n,`capture`)&&(s.capture=n.capture),n.reset&&c(),s.click()};return{files:tn(n),open:l,reset:c,onCancel:a,onChange:r}}const tF=1;function nF(e,t={}){let{throttle:n=0,idle:r=200,onStop:i=UN,onScroll:a=UN,offset:o={left:0,right:0,top:0,bottom:0},observe:s={mutation:!1},eventListenerOptions:c={capture:!1,passive:!0},behavior:l=`auto`,window:u=vP,onError:d=e=>{console.error(e)}}=t,f=typeof s==`boolean`?{mutation:s}:s,p=z(0),m=z(0),h=H({get(){return p.value},set(e){_(e,void 0)}}),g=H({get(){return m.value},set(e){_(void 0,e)}});function _(t,n){var r,i,a,o;if(!u)return;let s=B(e);if(!s)return;(a=s instanceof Document?u.document.body:s)==null||a.scrollTo({top:(r=B(n))??g.value,left:(i=B(t))??h.value,behavior:B(l)});let c=(o=s?.document)?.documentElement||s?.documentElement||s;h!=null&&(p.value=c.scrollLeft),g!=null&&(m.value=c.scrollTop)}let v=z(!1),y=$t({left:!0,right:!1,top:!0,bottom:!1}),b=$t({left:!1,right:!1,top:!1,bottom:!1}),x=e=>{v.value&&(v.value=!1,b.left=!1,b.right=!1,b.top=!1,b.bottom=!1,i(e))},S=sP(x,n+r),C=e=>{var t;if(!u)return;let n=(t=e?.document)?.documentElement||e?.documentElement||SP(e),{display:r,flexDirection:i,direction:a}=getComputedStyle(n),s=a===`rtl`?-1:1,c=n.scrollLeft;b.left=cp.value;let l=Math.abs(c*s)<=(o.left||0),d=Math.abs(c*s)+n.clientWidth>=n.scrollWidth-(o.right||0)-tF;r===`flex`&&i===`row-reverse`?(y.left=d,y.right=l):(y.left=l,y.right=d),p.value=c;let f=n.scrollTop;e===u.document&&!f&&(f=u.document.body.scrollTop),b.top=fm.value;let h=Math.abs(f)<=(o.top||0),g=Math.abs(f)+n.clientHeight>=n.scrollHeight-(o.bottom||0)-tF;r===`flex`&&i===`column-reverse`?(y.top=g,y.bottom=h):(y.top=h,y.bottom=g),m.value=f},w=e=>{var t;if(!u)return;let n=(t=e.target.documentElement)??e.target;C(n),v.value=!0,S(e),a(e)};return CP(e,`scroll`,n?lP(w,n,!0,!1):w,c),fP(()=>{try{let t=B(e);if(!t)return;C(t)}catch(e){d(e)}}),f?.mutation&&e!=null&&e!==u&&e!==document&&EP(e,()=>{let t=B(e);t&&C(t)},{attributes:!0,childList:!0,subtree:!0}),CP(e,`scrollend`,x,c),{x:h,y:g,isScrolling:v,arrivedState:y,directions:b,measure(){let t=B(e);u&&t&&C(t)}}}function rF(e,t,n={}){let{window:r=vP}=n;return UP(e,t,r?.localStorage,n)}const iF={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof MouseEvent?[e.movementX,e.movementY]:null};function aF(e={}){let{type:t=`page`,touch:n=!0,resetOnTouchEnds:r=!1,initialValue:i={x:0,y:0},window:a=vP,target:o=a,scroll:s=!0,eventFilter:c}=e,l=null,u=0,d=0,f=z(i.x),p=z(i.y),m=z(null),h=typeof t==`function`?t:iF[t],g=e=>{let t=h(e);l=e,t&&([f.value,p.value]=t,m.value=`mouse`),a&&(u=a.scrollX,d=a.scrollY)},_=e=>{if(e.touches.length>0){let t=h(e.touches[0]);t&&([f.value,p.value]=t,m.value=`touch`)}},v=()=>{if(!l||!a)return;let e=h(l);l instanceof MouseEvent&&e&&(f.value=e[0]+a.scrollX-u,p.value=e[1]+a.scrollY-d)},y=()=>{f.value=i.x,p.value=i.y},b=c?e=>c(()=>g(e),{}):e=>g(e),x=c?e=>c(()=>_(e),{}):e=>_(e),S=c?()=>c(()=>v(),{}):()=>v();if(o){let e={passive:!0};CP(o,[`mousemove`,`dragover`],b,e),n&&t!==`movement`&&(CP(o,[`touchstart`,`touchmove`],x,e),r&&CP(o,`touchend`,y,e)),s&&t===`page`&&CP(a,`scroll`,S,e)}return{x:f,y:p,sourceType:m}}function oF(e){let t=z(),n=()=>{t.value&&URL.revokeObjectURL(t.value),t.value=void 0};return V(()=>B(e),e=>{n(),e&&(t.value=URL.createObjectURL(e))},{immediate:!0}),PN(n),tn(t)}const sF=`--vueuse-safe-area-top`,cF=`--vueuse-safe-area-right`,lF=`--vueuse-safe-area-bottom`,uF=`--vueuse-safe-area-left`;function dF(){let e=z(``),t=z(``),n=z(``),r=z(``);if(RN){let e=KP(sF),t=KP(cF),n=KP(lF),r=KP(uF);e.value=`env(safe-area-inset-top, 0px)`,t.value=`env(safe-area-inset-right, 0px)`,n.value=`env(safe-area-inset-bottom, 0px)`,r.value=`env(safe-area-inset-left, 0px)`,fP(i),CP(`resize`,sP(i),{passive:!0})}function i(){e.value=fF(sF),t.value=fF(cF),n.value=fF(lF),r.value=fF(uF)}return{top:e,right:t,bottom:n,left:r,update:i}}function fF(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const pF=[{max:6e4,value:1e3,name:`second`},{max:276e4,value:6e4,name:`minute`},{max:72e6,value:36e5,name:`hour`},{max:5184e5,value:864e5,name:`day`},{max:24192e5,value:6048e5,name:`week`},{max:28512e6,value:2592e6,name:`month`},{max:1/0,value:31536e6,name:`year`}];function mF(e,t,n){let{window:r=vP}=n??{},i=R(null),a=z(),o=(...e)=>{a.value&&a.value.postMessage(...e)},s=function(){a.value&&a.value.terminate()};return r&&(typeof e==`string`?a.value=new Worker(e,t):typeof e==`function`?a.value=e():a.value=e,a.value.onmessage=e=>{i.value=e.data},PN(()=>{a.value&&a.value.terminate()})),{data:i,post:o,terminate:s,worker:a}}function hF(e={}){let{window:t=vP,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:i=!0,includeScrollbar:a=!0,type:o=`inner`}=e,s=z(n),c=z(r),l=()=>{if(t)if(o===`outer`)s.value=t.outerWidth,c.value=t.outerHeight;else if(o===`visual`&&t.visualViewport){let{width:e,height:n,scale:r}=t.visualViewport;s.value=Math.round(e*r),c.value=Math.round(n*r)}else a?(s.value=t.innerWidth,c.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,c.value=t.document.documentElement.clientHeight)};l(),fP(l);let u={passive:!0};if(CP(`resize`,l,u),t&&o===`visual`&&t.visualViewport&&CP(t.visualViewport,`resize`,l,u),i){let e=kP(`(orientation: portrait)`);V(e,()=>l())}return{width:s,height:c}}const gF=1/60*1e3,_F=typeof performance<`u`?()=>performance.now():()=>Date.now(),vF=typeof window<`u`?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(_F()),gF);function yF(e){let t=[],n=[],r=0,i=!1,a=!1,o=new WeakSet,s={schedule:(e,a=!1,s=!1)=>{let c=s&&i,l=c?t:n;return a&&o.add(e),l.indexOf(e)===-1&&(l.push(e),c&&i&&(r=t.length)),e},cancel:e=>{let t=n.indexOf(e);t!==-1&&n.splice(t,1),o.delete(e)},process:c=>{if(i){a=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let n=0;n(e[t]=yF(()=>SF=!0),e),{}),DF=TF.reduce((e,t)=>{let n=EF[t];return e[t]=(e,t=!1,r=!1)=>(SF||MF(),n.schedule(e,t,r)),e},{}),OF=TF.reduce((e,t)=>(e[t]=EF[t].cancel,e),{}),kF=TF.reduce((e,t)=>(e[t]=()=>EF[t].process(wF),e),{}),AF=e=>EF[e].process(wF),jF=e=>{SF=!1,wF.delta=xF?gF:Math.max(Math.min(e-wF.timestamp,bF),1),wF.timestamp=e,CF=!0,TF.forEach(AF),CF=!1,SF&&(xF=!1,vF(jF))},MF=()=>{SF=!0,xF=!0,CF||vF(jF)},NF=()=>wF;var PF=DF;function FF(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),zF=.001,BF=.01,VF=10,HF=.05,UF=1;function WF({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a;IF(e<=VF*1e3,`Spring duration must be 10 seconds or less`);let o=1-t;o=RF(HF,UF,o),e=RF(BF,VF,e/1e3),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=qF(t,o),c=Math.exp(-i);return zF-a/s*c},a=t=>{let r=t*o,a=r*e,s=a*n+n,c=o**2*t**2*e,l=Math.exp(-a),u=qF(t**2,o),d=-i(t)+zF>0?-1:1;return d*((s-c)*l)/u}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-zF+r*i},a=t=>{let r=Math.exp(-t*e),i=(n-t)*(e*e);return r*i});let s=5/e,c=KF(i,a,s);if(e*=1e3,isNaN(c))return{stiffness:100,damping:10,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}const GF=12;function KF(e,t,n){let r=n;for(let n=1;ne[t]!==void 0)}function ZF(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!XF(e,YF)&&XF(e,JF)){let n=WF(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function QF(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,a=FF(e,[`from`,`to`,`restSpeed`,`restDelta`]);let o={done:!1,value:t},{stiffness:s,damping:c,mass:l,velocity:u,duration:d,isResolvedFromDuration:f}=ZF(a),p=$F,m=$F;function h(){let e=u?-(u/1e3):0,r=n-t,a=c/(2*Math.sqrt(s*l)),o=Math.sqrt(s/l)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),a<1){let t=qF(o,a);p=i=>{let s=Math.exp(-a*o*i);return n-s*((e+a*o*r)/t*Math.sin(t*i)+r*Math.cos(t*i))},m=n=>{let i=Math.exp(-a*o*n);return a*o*i*(Math.sin(t*n)*(e+a*o*r)/t+r*Math.cos(t*n))-i*(Math.cos(t*n)*(e+a*o*r)-t*r*Math.sin(t*n))}}else if(a===1)p=t=>n-Math.exp(-o*t)*(r+(e+o*r)*t);else{let t=o*Math.sqrt(a*a-1);p=i=>{let s=Math.exp(-a*o*i),c=Math.min(t*i,300);return n-s*((e+a*o*r)*Math.sinh(c)+t*r*Math.cosh(c))/t}}}return h(),{next:e=>{let t=p(e);if(f)o.done=e>=d;else{let a=m(e)*1e3,s=Math.abs(a)<=r,c=Math.abs(n-t)<=i;o.done=s&&c}return o.value=o.done?n:t,o},flipTarget:()=>{u=-u,[t,n]=[n,t],h()}}}QF.needsInterpolation=(e,t)=>typeof e==`string`||typeof t==`string`;const $F=e=>0,eI=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},tI=(e,t,n)=>-n*e+n*t+e,nI=(e,t)=>n=>Math.max(Math.min(n,t),e),rI=e=>e%1?Number(e.toFixed(5)):e,iI=/(-)?([\d]*\.?[\d])+/g,aI=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,oI=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function sI(e){return typeof e==`string`}const cI={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},lI=Object.assign(Object.assign({},cI),{transform:nI(0,1)}),uI=Object.assign(Object.assign({},cI),{default:1}),dI=e=>({test:t=>sI(t)&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),fI=dI(`deg`),pI=dI(`%`),mI=dI(`px`),hI=dI(`vh`),gI=dI(`vw`),_I=Object.assign(Object.assign({},pI),{parse:e=>pI.parse(e)/100,transform:e=>pI.transform(e*100)}),vI=(e,t)=>n=>!!(sI(n)&&oI.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),yI=(e,t,n)=>r=>{if(!sI(r))return r;let[i,a,o,s]=r.match(iI);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},bI={test:vI(`hsl`,`hue`),parse:yI(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+pI.transform(rI(t))+`, `+pI.transform(rI(n))+`, `+rI(lI.transform(r))+`)`},xI=nI(0,255),SI=Object.assign(Object.assign({},cI),{transform:e=>Math.round(xI(e))}),CI={test:vI(`rgb`,`red`),parse:yI(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+SI.transform(e)+`, `+SI.transform(t)+`, `+SI.transform(n)+`, `+rI(lI.transform(r))+`)`};function wI(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const TI={test:vI(`#`),parse:wI,transform:CI.transform},EI={test:e=>CI.test(e)||TI.test(e)||bI.test(e),parse:e=>CI.test(e)?CI.parse(e):bI.test(e)?bI.parse(e):TI.parse(e),transform:e=>sI(e)?e:e.hasOwnProperty(`red`)?CI.transform(e):bI.transform(e)},DI="${c}",OI="${n}";function kI(e){var t,n,r,i;return isNaN(e)&&sI(e)&&((n=(t=e.match(iI))?.length)??0)+((i=(r=e.match(aI))?.length)??0)>0}function AI(e){typeof e==`number`&&(e=`${e}`);let t=[],n=0,r=e.match(aI);r&&(n=r.length,e=e.replace(aI,DI),t.push(...r.map(EI.parse)));let i=e.match(iI);return i&&(e=e.replace(iI,OI),t.push(...i.map(cI.parse))),{values:t,numColors:n,tokenised:e}}function jI(e){return AI(e).values}function MI(e){let{values:t,numColors:n,tokenised:r}=AI(e),i=t.length;return e=>{let t=r;for(let r=0;rtypeof e==`number`?0:e;function PI(e){let t=jI(e),n=MI(e);return n(t.map(NI))}const FI={test:kI,parse:jI,createTransformer:MI,getAnimatableNone:PI},II=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function LI(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(iI)||[];if(!r)return e;let i=n.replace(r,``),a=II.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}const RI=/([a-z-]*)\(.*?\)/g,zI=Object.assign(Object.assign({},FI),{getAnimatableNone:e=>{let t=e.match(RI);return t?t.map(LI).join(` `):e}});function BI(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function VI({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=BI(s,r,e+1/3),a=BI(s,r,e),o=BI(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}const HI=(e,t,n)=>{let r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},UI=[TI,CI,bI],WI=e=>UI.find(t=>t.test(e)),GI=e=>`'${e}' is not an animatable color. Use the equivalent color code instead.`,KI=(e,t)=>{let n=WI(e),r=WI(t);LF(!!n,GI(e)),LF(!!r,GI(t));let i=n.parse(e),a=r.parse(t);n===bI&&(i=VI(i),n=CI),r===bI&&(a=VI(a),r=CI);let o=Object.assign({},i);return e=>{for(let t in o)t!==`alpha`&&(o[t]=HI(i[t],a[t],e));return o.alpha=tI(i.alpha,a.alpha,e),n.transform(o)}},qI=e=>typeof e==`number`,JI=(e,t)=>n=>t(e(n)),YI=(...e)=>e.reduce(JI);function XI(e,t){return qI(e)?n=>tI(e,t,n):EI.test(e)?KI(e,t):eL(e,t)}const ZI=(e,t)=>{let n=[...e],r=n.length,i=e.map((e,n)=>XI(e,t[n]));return e=>{for(let t=0;t{let n=Object.assign(Object.assign({},e),t),r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=XI(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}};function $I(e){let t=FI.parse(e),n=t.length,r=0,i=0,a=0;for(let e=0;e{let n=FI.createTransformer(t),r=$I(e),i=$I(t),a=r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers;return a?YI(ZI(r.parsed,i.parsed),n):(IF(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),n=>`${n>0?t:e}`)},tL=(e,t)=>n=>tI(e,t,n);function nL(e){if(typeof e==`number`)return tL;if(typeof e==`string`)return EI.test(e)?KI:eL;if(Array.isArray(e))return ZI;if(typeof e==`object`)return QI}function rL(e,t,n){let r=[],i=n||nL(e[0]),a=e.length-1;for(let n=0;nn(eI(e,t,r))}function aL(e,t){let n=e.length,r=n-1;return i=>{let a=0,o=!1;if(i<=e[0]?o=!0:i>=e[r]&&(a=r-1,o=!0),!o){let t=1;for(;ti||t===r);t++);a=t-1}let s=eI(e[a],e[a+1],i);return t[a](s)}}function oL(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;LF(a===t.length,`Both input and output ranges must be the same length`),LF(!r||!Array.isArray(r)||r.length===a-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),e[0]>e[a-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());let o=rL(t,r,i),s=a===2?iL(e,o):aL(e,o);return n?t=>s(RF(e[0],e[a-1],t)):s}const sL=e=>t=>1-e(1-t),cL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,lL=e=>t=>t**+e,uL=e=>t=>t*t*((e+1)*t-e),dL=e=>{let t=uL(e);return e=>(e*=2)<1?.5*t(e):.5*(2-2**(-10*(e-1)))},fL=1.525,pL=4/11,mL=8/11,hL=9/10,gL=e=>e,_L=lL(2),vL=sL(_L),yL=cL(_L),bL=e=>1-Math.sin(Math.acos(e)),xL=sL(bL),SL=cL(xL),CL=uL(fL),wL=sL(CL),TL=cL(CL),EL=dL(fL),DL=4356/361,OL=35442/1805,kL=16061/1805,AL=e=>{if(e===1||e===0)return e;let t=e*e;return ee<.5?.5*(1-AL(1-e*2)):.5*AL(e*2-1)+.5;function NL(e,t){return e.map(()=>t||yL).splice(0,e.length-1)}function PL(e){let t=e.length;return e.map((e,n)=>n===0?0:n/(t-1))}function FL(e,t){return e.map(e=>e*t)}function IL({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){let a={done:!1,value:e},o=Array.isArray(t)?t:[e,t],s=FL(r&&r.length===o.length?r:PL(o),i);function c(){return oL(s,o,{ease:Array.isArray(n)?n:NL(o,n)})}let l=c();return{next:e=>(a.value=l(e),a.done=e>=i,a),flipTarget:()=>{o.reverse(),l=c()}}}function LL({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:a}){let o={done:!1,value:t},s=n*e,c=t+s,l=a===void 0?c:a(c);return l!==c&&(s=l-t),{next:e=>{let t=-s*Math.exp(-e/r);return o.done=!(t>i||t<-i),o.value=o.done?l:l+t,o},flipTarget:()=>{}}}const RL={keyframes:IL,spring:QF,decay:LL};function zL(e){if(Array.isArray(e.to))return IL;if(RL[e.type])return RL[e.type];let t=new Set(Object.keys(e));return t.has(`ease`)||t.has(`duration`)&&!t.has(`dampingRatio`)?IL:t.has(`dampingRatio`)||t.has(`stiffness`)||t.has(`mass`)||t.has(`damping`)||t.has(`restSpeed`)||t.has(`restDelta`)?QF:IL}function BL(e,t,n=0){return e-t-n}function VL(e,t,n=0,r=!0){return r?BL(t+-e,t,n):t-(e-t)+n}function HL(e,t,n,r){return r?e>=t+n:e<=-n}const UL=e=>{let t=({delta:t})=>e(t);return{start:()=>PF.update(t,!0),stop:()=>OF.update(t)}};function WL(e){var t,n,{from:r,autoplay:i=!0,driver:a=UL,elapsed:o=0,repeat:s=0,repeatType:c=`loop`,repeatDelay:l=0,onPlay:u,onStop:d,onComplete:f,onRepeat:p,onUpdate:m}=e,h=FF(e,[`from`,`autoplay`,`driver`,`elapsed`,`repeat`,`repeatType`,`repeatDelay`,`onPlay`,`onStop`,`onComplete`,`onRepeat`,`onUpdate`]);let{to:g}=h,_,v=0,y=h.duration,b,x=!1,S=!0,C,w=zL(h);(n=(t=w).needsInterpolation)?.call(t,r,g)&&(C=oL([0,100],[r,g],{clamp:!1}),r=0,g=100);let T=w(Object.assign(Object.assign({},h),{from:r,to:g}));function E(){v++,c===`reverse`?(S=v%2==0,o=VL(o,y,l,S)):(o=BL(o,y,l),c===`mirror`&&T.flipTarget()),x=!1,p&&p()}function D(){_.stop(),f&&f()}function O(e){if(S||(e=-e),o+=e,!x){let e=T.next(Math.max(0,o));b=e.value,C&&(b=C(b)),x=S?e.done:o<=0}m?.(b),x&&(v===0&&(y??=o),v{d?.(),_.stop()}}}function GL(e,t){return t?e*(1e3/t):0}function KL({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:a=750,bounceStiffness:o=500,bounceDamping:s=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:d,onComplete:f,onStop:p}){let m;function h(e){return n!==void 0&&er}function g(e){return n===void 0?r:r===void 0||Math.abs(n-e){var n;d?.(t),(n=e.onUpdate)==null||n.call(e,t)},onComplete:f,onStop:p}))}function v(e){_(Object.assign({type:`spring`,stiffness:o,damping:s,restDelta:c},e))}if(h(e))v({from:e,velocity:t,to:g(e)});else{let r=i*t+e;l!==void 0&&(r=l(r));let o=g(r),s=o===n?-1:1,u,d,f=e=>{u=d,d=e,t=GL(e-u,NF().delta),(s===1&&e>o||s===-1&&em?.stop()}}const qL=(e,t)=>1-3*t+3*e,JL=(e,t)=>3*t-6*e,YL=e=>3*e,XL=(e,t,n)=>((qL(t,n)*e+JL(t,n))*e+YL(t))*e,ZL=(e,t,n)=>3*qL(t,n)*e*e+2*JL(t,n)*e+YL(t),QL=1e-7,$L=10;function eR(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=XL(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>QL&&++s<$L);return o}const tR=8,nR=.001;function rR(e,t,n,r){for(let i=0;i=nR?rR(t,c,e,n):l===0?c:eR(t,r,r+aR,e,n)}return e=>e===0||e===1?e:XL(a(e),t,r)}const sR={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_TARGET_HUGGINGFACE_SPACE:`true`},cR={};var lR=class{constructor(){e.defineProperty(this,`subscriptions`,new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,n){if(this.subscriptions.size)for(let r of this.subscriptions)r(e,t,n)}clear(){this.subscriptions.clear()}};function uR(e){return!Number.isNaN(Number.parseFloat(e))}var dR=class{constructor(t){e.defineProperty(this,`current`,void 0),e.defineProperty(this,`prev`,void 0),e.defineProperty(this,`timeDelta`,0),e.defineProperty(this,`lastUpdated`,0),e.defineProperty(this,`updateSubscribers`,new lR),e.defineProperty(this,`stopAnimation`,void 0),e.defineProperty(this,`canTrackVelocity`,!1),e.defineProperty(this,`updateAndNotify`,e=>{this.prev=this.current,this.current=e;let{delta:t,timestamp:n}=NF();this.lastUpdated!==n&&(this.timeDelta=t,this.lastUpdated=n),PF.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)}),e.defineProperty(this,`scheduleVelocityCheck`,()=>PF.postRender(this.velocityCheck)),e.defineProperty(this,`velocityCheck`,({timestamp:e})=>{this.canTrackVelocity||=uR(this.current),e!==this.lastUpdated&&(this.prev=this.current)}),this.prev=this.current=t,this.canTrackVelocity=uR(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?GL(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{let{stop:n}=e(t);this.stopAnimation=n}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}};function fR(e){return new dR(e)}const{isArray:pR}=Array;function mR(){let e=R({}),t=t=>{let n=t=>{e.value[t]&&(e.value[t].stop(),e.value[t].destroy(),delete e.value[t])};t?pR(t)?t.forEach(n):n(t):Object.keys(e.value).forEach(n)},n=(t,n,r)=>{if(e.value[t])return e.value[t];let i=fR(n);return i.onChange(e=>r[t]=e),e.value[t]=i,i};return pP(t),{motionValues:e,get:n,stop:t}}function hR(e){return Array.isArray(e)}function gR(){return{type:`spring`,stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function _R(e){return{type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function vR(e){return{type:`spring`,stiffness:550,damping:e===0?100:30,restDelta:.01,restSpeed:10}}function yR(){return{type:`keyframes`,ease:`linear`,duration:300}}function bR(e){return{type:`keyframes`,duration:800,values:e}}const xR={default:vR,x:gR,y:gR,z:gR,rotate:gR,rotateX:gR,rotateY:gR,rotateZ:gR,scaleX:_R,scaleY:_R,scale:_R,backgroundColor:yR,color:yR,opacity:yR};function SR(e,t){let n;return n=hR(t)?bR:xR[e]||xR.default,{to:t,...n(t)}}const CR={...cI,transform:Math.round},wR={color:EI,backgroundColor:EI,outlineColor:EI,fill:EI,stroke:EI,borderColor:EI,borderTopColor:EI,borderRightColor:EI,borderBottomColor:EI,borderLeftColor:EI,borderWidth:mI,borderTopWidth:mI,borderRightWidth:mI,borderBottomWidth:mI,borderLeftWidth:mI,borderRadius:mI,radius:mI,borderTopLeftRadius:mI,borderTopRightRadius:mI,borderBottomRightRadius:mI,borderBottomLeftRadius:mI,width:mI,maxWidth:mI,height:mI,maxHeight:mI,size:mI,top:mI,right:mI,bottom:mI,left:mI,padding:mI,paddingTop:mI,paddingRight:mI,paddingBottom:mI,paddingLeft:mI,margin:mI,marginTop:mI,marginRight:mI,marginBottom:mI,marginLeft:mI,rotate:fI,rotateX:fI,rotateY:fI,rotateZ:fI,scale:uI,scaleX:uI,scaleY:uI,scaleZ:uI,skew:fI,skewX:fI,skewY:fI,distance:mI,translateX:mI,translateY:mI,translateZ:mI,x:mI,y:mI,z:mI,perspective:mI,transformPerspective:mI,opacity:lI,originX:_I,originY:_I,originZ:mI,zIndex:CR,filter:zI,WebkitFilter:zI,fillOpacity:lI,strokeOpacity:lI,numOctaves:CR},TR=e=>wR[e];function ER(e,t){return t&&typeof e==`number`&&t.transform?t.transform(e):e}function DR(e,t){let n=TR(e);return n!==zI&&(n=FI),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const OR={linear:gL,easeIn:_L,easeInOut:yL,easeOut:vL,circIn:bL,circInOut:SL,circOut:xL,backIn:CL,backInOut:TL,backOut:wL,anticipate:EL,bounceIn:jL,bounceInOut:ML,bounceOut:AL};function kR(e){if(Array.isArray(e)){let[t,n,r,i]=e;return oR(t,n,r,i)}else if(typeof e==`string`)return OR[e];return e}function AR(e){return Array.isArray(e)&&typeof e[0]!=`number`}function jR(e,t){return e===`zIndex`?!1:!!(typeof t==`number`||Array.isArray(t)||typeof t==`string`&&FI.test(t)&&!t.startsWith(`url(`))}function MR(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function NR({ease:e,times:t,delay:n,...r}){let i={...r};return t&&(i.offset=t),e&&(i.ease=AR(e)?e.map(kR):kR(e)),n&&(i.elapsed=-n),i}function PR(e,t,n){return Array.isArray(t.to)&&(e.duration||=800),MR(t),FR(e)||(e={...e,...SR(n,t.to)}),{...t,...NR(e)}}function FR({delay:e,repeat:t,repeatType:n,repeatDelay:r,from:i,...a}){return!!Object.keys(a).length}function IR(e,t){return e[t]||e.default||e}function LR(e,t,n,r,i){let a=IR(r,e),o=a.from===null||a.from===void 0?t.get():a.from,s=jR(e,n);o===`none`&&s&&typeof n==`string`&&(o=DR(e,n));let c=jR(e,o);function l(s){let c={from:o,to:n,velocity:r.velocity?r.velocity:t.getVelocity(),onUpdate:e=>t.set(e)};return a.type===`inertia`||a.type===`decay`?KL({...c,...a}):WL({...PR(a,c,e),onUpdate:e=>{c.onUpdate(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{i&&i(),s&&s()}})}function u(e){return t.set(n),i&&i(),e&&e(),{stop:()=>{}}}return!c||!s||a.type===!1?u:l}function RR(){let{motionValues:e,stop:t,get:n}=mR(),r=(e,t,r,i={},a)=>{let o=r[e],s=n(e,o,r);if(i&&i.immediate){s.set(t);return}let c=LR(e,s,t,i,a);s.start(c)};return{motionValues:e,stop:t,push:r}}function zR(e,t={},{motionValues:n,push:r,stop:i}=RR()){let a=_n(t),o=R(!1);V(n,e=>{o.value=Object.values(e).filter(e=>e.isAnimating()).length>0},{immediate:!0,deep:!0});let s=e=>{if(!a||!a[e])throw Error(`The variant ${e} does not exist.`);return a[e]},c=t=>{typeof t==`string`&&(t=s(t));let n=Object.entries(t).map(([n,i])=>{if(n!==`transition`)return new Promise(a=>r(n,i,e,t.transition||SR(n,t[n]),a))}).filter(Boolean);async function i(){var e,r;await Promise.all(n),(e=t.transition)==null||(r=e.onComplete)==null||r.call(e)}return Promise.all([i()])},l=t=>{let n=HN(t)?t:s(t);Object.entries(n).forEach(([t,n])=>{t!==`transition`&&r(t,n,e,{immediate:!0})})},u=async e=>{let t;if(a&&(a.leave&&(t=a.leave),!a.leave&&a.initial&&(t=a.initial)),!t){e();return}await c(t),e()};return{isAnimating:o,apply:c,set:l,leave:u,stop:i}}const BR=typeof window<`u`,VR=()=>BR&&(window.onpointerdown===null||sR?.TEST),HR=()=>BR&&(window.ontouchstart===null||sR?.TEST),UR=()=>BR&&(window.onmousedown===null||sR?.TEST);function WR({target:e,state:t,variants:n,apply:r}){let i=_n(n),a=R(!1),o=R(!1),s=R(!1),c=H(()=>{let e=[...Object.keys(t.value||{})];return i?(i.hovered&&(e=[...e,...Object.keys(i.hovered)]),i.tapped&&(e=[...e,...Object.keys(i.tapped)]),i.focused&&(e=[...e,...Object.keys(i.focused)]),e):e}),l=H(()=>{let e={};for(let n in Object.assign(e,t.value),a.value&&i.hovered&&Object.assign(e,i.hovered),o.value&&i.tapped&&Object.assign(e,i.tapped),s.value&&i.focused&&Object.assign(e,i.focused),e)c.value.includes(n)||delete e[n];return e});i.hovered&&(CP(e,`mouseenter`,()=>a.value=!0),CP(e,`mouseleave`,()=>{a.value=!1,o.value=!1})),i.tapped&&(UR()&&(CP(e,`mousedown`,()=>o.value=!0),CP(e,`mouseup`,()=>o.value=!1)),VR()&&(CP(e,`pointerdown`,()=>o.value=!0),CP(e,`pointerup`,()=>o.value=!1)),HR()&&(CP(e,`touchstart`,()=>o.value=!0),CP(e,`touchend`,()=>o.value=!1))),i.focused&&(CP(e,`focus`,()=>s.value=!0),CP(e,`blur`,()=>s.value=!1)),V([a,o,s],()=>{r(l.value)})}function GR({set:e,target:t,variants:n,variant:r}){let i=_n(n);V(()=>t,()=>{i&&(i.initial&&(e(`initial`),r.value=`initial`),i.enter&&(r.value=`enter`))},{immediate:!0,flush:`pre`})}function KR({state:e,apply:t}){V(e,e=>{e&&t(e)},{immediate:!0})}function qR({target:e,variants:t,variant:n}){let r=_n(t);r&&(r.visible||r.visibleOnce)&&ZP(e,([{isIntersecting:e}])=>{r.visible?e?n.value=`visible`:n.value=`initial`:r.visibleOnce&&(e&&n.value!==`visibleOnce`?n.value=`visibleOnce`:n.value||=`initial`)})}function JR(e,t={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){t.lifeCycleHooks&&GR(e),t.syncVariants&&KR(e),t.visibilityHooks&&qR(e),t.eventListeners&&WR(e)}function YR(e={}){let t=$t({...e}),n=R({});return V(t,()=>{let e={};for(let[n,r]of Object.entries(t)){let t=TR(n),i=ER(r,t);e[n]=i}n.value=e},{immediate:!0,deep:!0}),{state:t,style:n}}function XR(e,t){V(()=>SP(e),e=>{e&&t(e)},{immediate:!0})}const ZR={x:`translateX`,y:`translateY`,z:`translateZ`};function QR(e={},t=!0){let n=$t({...e}),r=R(``);return V(n,e=>{let n=``,i=!1;if(t&&(e.x||e.y||e.z)){let t=[e.x||0,e.y||0,e.z||0].map(e=>ER(e,mI)).join(`,`);n+=`translate3d(${t}) `,i=!0}for(let[r,i]of Object.entries(e)){if(t&&(r===`x`||r===`y`||r===`z`))continue;let e=TR(r),a=ER(i,e);n+=`${ZR[r]||r}(${a}) `}t&&!i&&(n+=`translateZ(0px) `),r.value=n.trim()},{immediate:!0,deep:!0}),{state:n,transform:r}}const $R=[``,`X`,`Y`,`Z`],ez=[`perspective`,`translate`,`scale`,`rotate`,`skew`],tz=[`transformPerspective`,`x`,`y`,`z`];ez.forEach(e=>{$R.forEach(t=>{let n=e+t;tz.push(n)})});const nz=new Set(tz);function rz(e){return nz.has(e)}const iz=new Set([`originX`,`originY`,`originZ`]);function az(e){return iz.has(e)}function oz(e){let t={},n={};return Object.entries(e).forEach(([e,r])=>{rz(e)||az(e)?t[e]=r:n[e]=r}),{transform:t,style:n}}function sz(e){let{transform:t,style:n}=oz(e),{transform:r}=QR(t),{style:i}=YR(n);return r.value&&(i.value.transform=r.value),i.value}function cz(e,t){let n,r,{state:i,style:a}=YR();return XR(e,e=>{r=e;for(let t of Object.keys(wR)){if(e.style[t]===null||e.style[t]===``||rz(t)||az(t))continue;i[t]=e.style[t]}n&&Object.entries(n).forEach(([t,n])=>e.style[t]=n),t&&t(i)}),V(a,e=>{if(!r){n=e;return}for(let t in e)r.style[t]=e[t]},{immediate:!0}),{style:i}}function lz(e){let t=e.trim().split(/\) |\)/);if(t.length===1)return{};let n=e=>e.endsWith(`px`)||e.endsWith(`deg`)?Number.parseFloat(e):Number.isNaN(Number(e))?Number(e):e;return t.reduce((e,t)=>{if(!t)return e;let[r,i]=t.split(`(`),a=i.split(`,`),o=a.map(e=>n(e.endsWith(`)`)?e.replace(`)`,``):e.trim())),s=o.length===1?o[0]:o;return{...e,[r]:s}},{})}function uz(e,t){Object.entries(lz(t)).forEach(([t,n])=>{let r=[`x`,`y`,`z`];if(t===`translate3d`){if(n===0){r.forEach(t=>e[t]=0);return}n.forEach((t,n)=>e[r[n]]=t);return}if(n=Number.parseFloat(`${n}`),t===`translateX`){e.x=n;return}if(t===`translateY`){e.y=n;return}if(t===`translateZ`){e.z=n;return}e[t]=n})}function dz(e,t){let n,r,{state:i,transform:a}=QR();return XR(e,e=>{r=e,e.style.transform&&uz(i,e.style.transform),n&&(e.style.transform=n),t&&t(i)}),V(a,e=>{if(!r){n=e;return}r.style.transform=e},{immediate:!0}),{transform:i}}function fz(e){return Object.entries(e)}function pz(e,t){let n=$t({}),r=e=>Object.entries(e).forEach(([e,t])=>n[e]=t),{style:i}=cz(e,r),{transform:a}=dz(e,r);return V(n,e=>{fz(e).forEach(([e,t])=>{let n=rz(e)?a:i;n[e]&&n[e]===t||(n[e]=t)})},{immediate:!0,deep:!0}),XR(e,()=>t&&r(t)),{motionProperties:n,style:i,transform:a}}function mz(e={}){let t=_n(e),n=R(),r=H(()=>{if(n.value)return t[n.value]});return{state:r,variant:n}}function hz(e,t={},n){let{motionProperties:r}=pz(e),{variant:i,state:a}=mz(t),o=zR(r,t),s={target:e,variant:i,variants:t,state:a,motionProperties:r,...o};return JR(s,n),s}const gz=[`delay`,`duration`],_z=[`initial`,`enter`,`leave`,`visible`,`visible-once`,`visibleOnce`,`hovered`,`tapped`,`focused`,...gz];function vz(e){return gz.includes(e)}function yz(e,t){let n=e.props?e.props:e.data&&e.data.attrs?e.data.attrs:{};if(n){n.variants&&HN(n.variants)&&(t.value={...t.value,...n.variants});for(let e of _z){if(!n||!n[e])continue;if(vz(e)&&typeof n[e]==`number`){for(let r of[`enter`,`visible`,`visibleOnce`]){let i=t.value[r];if(i==null)continue;i.transition??={},i.transition[e]=n[e]}continue}if(HN(n[e])){let r=n[e];e===`visible-once`&&(e=`visibleOnce`),t.value[e]=r}}}}function bz(e,t=!1){let n=(n,r,i)=>{let a=r.value&&typeof r.value==`string`?r.value:i.key;a&&cR[a]&&cR[a].stop();let o=t?structuredClone(ln(e)||{}):e||{},s=R(o);typeof r.value==`object`&&(s.value=r.value),yz(i,s);let c={eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1},l=hz(n,s,c);n.motionInstance=l,a&&(cR[a]=l)},r=(e,t,n)=>{e.motionInstance&&qR(e.motionInstance)};return{created:n,mounted:r,getSSRProps(t,n){let{initial:r}=t.value||n&&n?.props||{};r=_n(r);let i=jN({},e?.initial||{},r||{});if(!i||Object.keys(i).length===0)return;let a=sz(i);return{style:a}}}}const xz={initial:{opacity:0},enter:{opacity:1}},Sz={initial:{opacity:0},visible:{opacity:1}},Cz={initial:{opacity:0},visibleOnce:{opacity:1}},wz={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},Tz={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},Ez={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},Dz={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},Oz={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},kz={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},Az={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},jz={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},Mz={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},Nz={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},Pz={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Fz={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},Iz={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},Lz={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Rz={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},zz={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},Bz={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},Vz={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},Hz={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Uz={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},Wz={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},Gz={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},Kz={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},qz={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},Jz={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},Yz={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},Xz={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Zz={__proto__:null,fade:xz,fadeVisible:Sz,fadeVisibleOnce:Cz,pop:wz,popVisible:Tz,popVisibleOnce:Ez,rollBottom:Iz,rollLeft:Dz,rollRight:Az,rollTop:Nz,rollVisibleBottom:Lz,rollVisibleLeft:Oz,rollVisibleOnceBottom:Rz,rollVisibleOnceLeft:kz,rollVisibleOnceRight:Mz,rollVisibleOnceTop:Fz,rollVisibleRight:jz,rollVisibleTop:Pz,slideBottom:Jz,slideLeft:zz,slideRight:Hz,slideTop:Gz,slideVisibleBottom:Yz,slideVisibleLeft:Bz,slideVisibleOnceBottom:Xz,slideVisibleOnceLeft:Vz,slideVisibleOnceRight:Wz,slideVisibleOnceTop:qz,slideVisibleRight:Uz,slideVisibleTop:Kz};function Qz(e){let t=`àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;`,n=`aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------`,r=new RegExp(t.split(``).join(`|`),`g`);return e.toString().replace(/[A-Z]/g,e=>`-${e}`).toLowerCase().replace(/\s+/g,`-`).replace(r,e=>n.charAt(t.indexOf(e))).replace(/&/g,`-and-`).replace(/[^\w\-]+/g,``).replace(/-{2,}/g,`-`).replace(/^-+/,``).replace(/-+$/,``)}const $z=Symbol(``),eB={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function tB(e){return Object.prototype.toString.call(e)===`[object Object]`}function nB(e){if(Array.isArray(e))return e.map(nB);if(tB(e)){let t={};for(let n in e)t[n]=nB(e[n]);return t}return e}function rB(e){let t=$t({}),n=Zi($z,{}),r=H(()=>e.preset==null?{}:n!=null&&e.preset in n?structuredClone(ln(n)[e.preset]):e.preset in Zz?structuredClone(Zz[e.preset]):{}),i=H(()=>({initial:e.initial,enter:e.enter,leave:e.leave,visible:e.visible,visibleOnce:e.visibleOnce,hovered:e.hovered,tapped:e.tapped,focused:e.focused}));function a(e,t){for(let n of[`delay`,`duration`]){if(t[n]==null)continue;let r=Number.parseInt(t[n]);for(let t of[`enter`,`visible`,`visibleOnce`]){let i=e[t];if(i==null)continue;i.transition??={},i.transition[n]=r}}return e}let o=H(()=>{let t=jN({},i.value,r.value,e.variants||{});return a({...t},e)});function s(e,n,r){var i;e.props??={},(i=e.props).style??(i.style={}),e.props.style={...e.props.style,...r};let s=a(nB(o.value),e.props);return e.props.onVnodeMounted=({el:e})=>{t[n]=hz(e,s)},e.props.onVnodeUpdated=({el:e})=>{let r=sz(t[n].state);for(let[t,n]of Object.entries(r))e.style[t]=n},e}return{motionConfig:o,setNodeInstance:s}}const iB=Rr({name:`Motion`,props:{...eB,is:{type:[String,Object],default:`div`}},setup(e){let t=wi(),{motionConfig:n,setNodeInstance:r}=rB(e);return()=>{let i=sz(n.value.initial||{}),a=Jo(e.is,void 0,t);return r(a,0,i),a}}}),aB=Rr({name:`MotionGroup`,props:{...eB,is:{type:[String,Object],required:!1}},setup(e){let t=wi(),{motionConfig:n,setNodeInstance:r}=rB(e);return()=>{var i;let a=sz(n.value.initial||{}),o=(i=t.default)?.call(t)||[];for(let e=0;e{(function(n,r){typeof define==`function`&&define.amd?define(r):typeof exports==`object`?t.exports=r():n.NProgress=r()})(void 0,function(){var e={};e.version=`0.2.0`;var t=e.settings={minimum:.08,easing:`ease`,positionUsing:``,speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:`[role="bar"]`,spinnerSelector:`[role="spinner"]`,parent:`body`,template:`
`};e.configure=function(e){var n,r;for(n in e)r=e[n],r!==void 0&&e.hasOwnProperty(n)&&(t[n]=r);return this},e.status=null,e.set=function(r){var s=e.isStarted();r=n(r,t.minimum,1),e.status=r===1?null:r;var c=e.render(!s),l=c.querySelector(t.barSelector),u=t.speed,d=t.easing;return c.offsetWidth,a(function(n){t.positionUsing===``&&(t.positionUsing=e.getPositioningCSS()),o(l,i(r,u,d)),r===1?(o(c,{transition:`none`,opacity:1}),c.offsetWidth,setTimeout(function(){o(c,{transition:`all `+u+`ms linear`,opacity:0}),setTimeout(function(){e.remove(),n()},u)},u)):setTimeout(n,u)}),this},e.isStarted=function(){return typeof e.status==`number`},e.start=function(){e.status||e.set(0);var n=function(){setTimeout(function(){e.status&&(e.trickle(),n())},t.trickleSpeed)};return t.trickle&&n(),this},e.done=function(t){return!t&&!e.status?this:e.inc(.3+.5*Math.random()).set(1)},e.inc=function(t){var r=e.status;return r?(typeof t!=`number`&&(t=(1-r)*n(Math.random()*r,.1,.95)),r=n(r+t,0,.994),e.set(r)):e.start()},e.trickle=function(){return e.inc(Math.random()*t.trickleRate)},function(){var t=0,n=0;e.promise=function(r){return!r||r.state()===`resolved`?this:(n===0&&e.start(),t++,n++,r.always(function(){n--,n===0?(t=0,e.done()):e.set((t-n)/t)}),this)}}(),e.render=function(n){if(e.isRendered())return document.getElementById(`nprogress`);c(document.documentElement,`nprogress-busy`);var i=document.createElement(`div`);i.id=`nprogress`,i.innerHTML=t.template;var a=i.querySelector(t.barSelector),s=n?`-100`:r(e.status||0),l=document.querySelector(t.parent),u;return o(a,{transition:`all 0 linear`,transform:`translate3d(`+s+`%,0,0)`}),t.showSpinner||(u=i.querySelector(t.spinnerSelector),u&&d(u)),l!=document.body&&c(l,`nprogress-custom-parent`),l.appendChild(i),i},e.remove=function(){l(document.documentElement,`nprogress-busy`),l(document.querySelector(t.parent),`nprogress-custom-parent`);var e=document.getElementById(`nprogress`);e&&d(e)},e.isRendered=function(){return!!document.getElementById(`nprogress`)},e.getPositioningCSS=function(){var e=document.body.style,t=`WebkitTransform`in e?`Webkit`:`MozTransform`in e?`Moz`:`msTransform`in e?`ms`:`OTransform`in e?`O`:``;return t+`Perspective`in e?`translate3d`:t+`Transform`in e?`translate`:`margin`};function n(e,t,n){return en?n:e}function r(e){return(-1+e)*100}function i(e,n,i){var a;return a=t.positionUsing===`translate3d`?{transform:`translate3d(`+r(e)+`%,0,0)`}:t.positionUsing===`translate`?{transform:`translate(`+r(e)+`%,0)`}:{"margin-left":r(e)+`%`},a.transition=`all `+n+`ms `+i,a}var a=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),e.length==1&&t()}}(),o=function(){var e=[`Webkit`,`O`,`Moz`,`ms`],t={};function n(e){return e.replace(/^-ms-/,`ms-`).replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()})}function r(t){var n=document.body.style;if(t in n)return t;for(var r=e.length,i=t.charAt(0).toUpperCase()+t.slice(1),a;r--;)if(a=e[r]+i,a in n)return a;return t}function i(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=i(t),e.style[t]=n}return function(e,t){var n=arguments,r,i;if(n.length==2)for(r in t)i=t[r],i!==void 0&&t.hasOwnProperty(r)&&a(e,r,i);else a(e,n[1],n[2])}}();function s(e,t){var n=typeof e==`string`?e:u(e);return n.indexOf(` `+t+` `)>=0}function c(e,t){var n=u(e),r=n+t;s(n,t)||(e.className=r.substring(1))}function l(e,t){var n=u(e),r;s(e,t)&&(r=n.replace(` `+t+` `,` `),e.className=r.substring(1,r.length-1))}function u(e){return(` `+(e.className||``)+` `).replace(/\s+/gi,` `)}function d(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return e})});let cB;const lB=e=>cB=e,uB=Symbol();function dB(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var fB;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(fB||={});const pB=typeof window<`u`,mB=(()=>typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null})();function hB(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function gB(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){xB(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function _B(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function vB(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}const yB=typeof navigator==`object`?navigator:{userAgent:``},bB=(()=>/Macintosh/.test(yB.userAgent)&&/AppleWebKit/.test(yB.userAgent)&&!/Safari/.test(yB.userAgent))(),xB=pB?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!bB?SB:`msSaveOrOpenBlob`in yB?CB:wB:()=>{};function SB(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?vB(r):_B(r.href)?gB(e,t,n):(r.target=`_blank`,vB(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){vB(r)},0))}function CB(e,t=`download`,n){if(typeof e==`string`)if(_B(e))gB(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){vB(t)})}else navigator.msSaveOrOpenBlob(hB(e,n),t)}function wB(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return gB(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(mB.HTMLElement))||`safari`in mB,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||bB)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}const{assign:TB}=Object;function EB(){let e=Re(!0),t=e.run(()=>R({})),n=[],r=[],i=un({install(e){lB(i),i._a=e,e.provide(uB,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const DB=()=>{};function OB(e,t,n,r=DB){e.push(t);let i=()=>{let n=e.indexOf(t);n>-1&&(e.splice(n,1),r())};return!n&&ze()&&Be(i),i}function kB(e,...t){e.slice().forEach(e=>{e(...t)})}const AB=e=>e(),jB=Symbol(),MB=Symbol();function NB(e,t){for(let n in e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e),t){if(!t.hasOwnProperty(n))continue;let r=t[n],i=e[n];dB(i)&&dB(r)&&e.hasOwnProperty(n)&&!pn(r)&&!an(r)?e[n]=NB(i,r):e[n]=r}return e}const PB=Symbol();function FB(e){return!dB(e)||!Object.prototype.hasOwnProperty.call(e,PB)}const{assign:IB}=Object;function LB(e){return!!(pn(e)&&e.effect)}function RB(e,t,n,r){let{state:i,actions:a,getters:o}=t,s=n.state.value[e],c;function l(){s||(n.state.value[e]=i?i():{});let t=Sn(n.state.value[e]);return IB(t,a,Object.keys(o||{}).reduce((t,r)=>(t[r]=un(H(()=>{lB(n);let t=n._s.get(e);return o[r].call(t,t)})),t),{}))}return c=zB(e,l,t,n,r,!0),c}function zB(e,t,n={},r,i,a){let o,s=IB({actions:{}},n),c={deep:!0},l,u,d=[],f=[],p,m=r.state.value[e];!a&&!m&&(r.state.value[e]={});let h=R({}),g;function _(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:fB.patchFunction,storeId:e,events:p}):(NB(r.state.value[e],t),n={type:fB.patchObject,payload:t,storeId:e,events:p});let i=g=Symbol();Kn().then(()=>{g===i&&(l=!0)}),u=!0,kB(d,n,r.state.value[e])}let v=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{IB(e,t)})}:DB;function y(){o.stop(),d=[],f=[],r._s.delete(e)}let b=(t,n=``)=>{if(jB in t)return t[MB]=n,t;let i=function(){lB(r);let n=Array.from(arguments),a=[],o=[];function s(e){a.push(e)}function c(e){o.push(e)}kB(f,{args:n,name:i[MB],store:C,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:C,n)}catch(e){throw kB(o,e),e}return l instanceof Promise?l.then(e=>(kB(a,e),e)).catch(e=>(kB(o,e),Promise.reject(e))):(kB(a,l),l)};return i[jB]=!0,i[MB]=n,i},x=un({actions:{},getters:{},state:[],hotState:h}),S={_p:r,$id:e,$onAction:OB.bind(null,f),$patch:_,$reset:v,$subscribe(t,n={}){let i=OB(d,t,n.detached,()=>a()),a=o.run(()=>V(()=>r.state.value[e],r=>{(n.flush===`sync`?u:l)&&t({storeId:e,type:fB.direct,events:p},r)},IB({},c,n)));return i},$dispose:y},C=$t(S);r._s.set(e,C);let w=r._a&&r._a.runWithContext||AB,T=w(()=>r._e.run(()=>(o=Re()).run(()=>t({action:b}))));for(let t in T){let n=T[t];if(pn(n)&&!LB(n)||an(n))a||(m&&FB(n)&&(pn(n)?n.value=m[t]:NB(n,m[t])),r.state.value[e][t]=n);else if(typeof n==`function`){let e=b(n,t);T[t]=e,s.actions[t]=n}}return IB(C,T),IB(ln(C),T),Object.defineProperty(C,`$state`,{get:()=>r.state.value[e],set:e=>{_(t=>{IB(t,e)})}}),r._p.forEach(e=>{IB(C,o.run(()=>e({store:C,app:r._a,pinia:r,options:s})))}),m&&a&&n.hydrate&&n.hydrate(C.$state,m),l=!0,u=!0,C} /*! #__NO_SIDE_EFFECTS__ */ -function BB(e,t,n){let r,i=typeof t==`function`;r=i?n:t;function a(n,a){let o=Qi();n||=o?Zi(uB,null):null,n&&lB(n),n=cB,n._s.has(e)||(i?zB(e,t,r,n):RB(e,r,n));let s=n._s.get(e);return s}return a.$id=e,a}function VB(e){let t=ln(e),n={};for(let r in t){let i=t[r];i.effect?n[r]=H({get:()=>e[r],set(t){e[r]=t}}):(pn(i)||an(i))&&(n[r]=Tn(e,r))}return n}const HB=`modulepreload`,UB=function(e){return`/`+e},WB={},Y=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=document.getElementsByTagName(`link`),a=document.querySelector(`meta[property=csp-nonce]`),o=a?.nonce||a?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=UB(e,n),e in WB)return;WB[e]=!0;let t=e.endsWith(`.css`),r=t?`[rel="stylesheet"]`:``,a=!!n;if(a)for(let n=i.length-1;n>=0;n--){let r=i[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${e}"]${r}`))return;let s=document.createElement(`link`);if(s.rel=t?`stylesheet`:HB,t||(s.as=`script`),s.crossOrigin=``,s.href=e,o&&s.setAttribute(`nonce`,o),document.head.appendChild(s),t)return new Promise((t,n)=>{s.addEventListener(`load`,t),s.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[]){if(e.status!==`rejected`)continue;i(e.reason)}return e().catch(i)})},GB=e=>{let t={},n=Object.assign({"/src/layouts/default.vue":()=>Y(()=>import(`./default-Db8QsuAx.js`),__vite__mapDeps([0,1,2])),"/src/layouts/home.vue":()=>Y(()=>import(`./home-YO2AF9Ir.js`),[]),"/src/layouts/settings.vue":()=>Y(()=>import(`./settings-_CwCCEeu.js`),__vite__mapDeps([3,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),"/src/layouts/stage.vue":()=>Y(()=>import(`./stage-Dp_65zGQ.js`),[])});Object.entries(n).forEach(([e,n])=>{let r=e.replace(`/src/layouts/`,``).replace(`.vue`,``);t[r]=n});function r(e,n=!0){return e.map(e=>{var i,a,o;if((i=e.children)?.length>0&&(e.children=r(e.children,!1)),n){var s,c,l;let n=!e.component&&(s=e.children)?.find(e=>{var t;return(e.path===``||e.path===`/`)&&(t=e.meta)?.isLayout});if(n)return e;if((c=e.meta)?.layout!==!1)return{path:e.path,component:t[(l=e.meta)?.layout||`default`],children:e.path===`/`?[e]:[{...e,path:``}],meta:{isLayout:!0}}}return(a=e.meta)?.layout?{path:e.path,component:t[(o=e.meta)?.layout],children:[{...e,path:``}],meta:{isLayout:!0}}:e})}return r(e)},KB=typeof document<`u`;function qB(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function JB(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&qB(e.default)}const YB=Object.assign;function XB(e,t){let n={};for(let r in t){let i=t[r];n[r]=QB(i)?i.map(e):e(i)}return n}const ZB=()=>{},QB=Array.isArray,$B=/#/g,eV=/&/g,tV=/\//g,nV=/=/g,rV=/\?/g,iV=/\+/g,aV=/%5B/g,oV=/%5D/g,sV=/%5E/g,cV=/%60/g,lV=/%7B/g,uV=/%7C/g,dV=/%7D/g,fV=/%20/g;function pV(e){return encodeURI(``+e).replace(uV,`|`).replace(aV,`[`).replace(oV,`]`)}function mV(e){return pV(e).replace(lV,`{`).replace(dV,`}`).replace(sV,`^`)}function hV(e){return pV(e).replace(iV,`%2B`).replace(fV,`+`).replace($B,`%23`).replace(eV,`%26`).replace(cV,"`").replace(lV,`{`).replace(dV,`}`).replace(sV,`^`)}function gV(e){return hV(e).replace(nV,`%3D`)}function _V(e){return pV(e).replace($B,`%23`).replace(rV,`%3F`)}function vV(e){return e==null?``:_V(e).replace(tV,`%2F`)}function yV(e){try{return decodeURIComponent(``+e)}catch{}return``+e}const bV=/\/$/,xV=e=>e.replace(bV,``);function SV(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return s=0&&(c=-1),c>-1&&(r=t.slice(0,c),a=t.slice(c+1,s>-1?s:t.length),i=e(a)),s>-1&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=AV(r??t,n),{fullPath:r+(a&&`?`)+a+o,path:r,query:i,hash:yV(o)}}function CV(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function wV(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function TV(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&EV(t.matched[r],n.matched[i])&&DV(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function EV(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function DV(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!OV(e[n],t[n]))return!1;return!0}function OV(e,t){return QB(e)?kV(e,t):QB(t)?kV(t,e):e===t}function kV(e,t){return QB(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function AV(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}const jV={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};var MV;(function(e){e.pop=`pop`,e.push=`push`})(MV||={});var NV;(function(e){e.back=`back`,e.forward=`forward`,e.unknown=``})(NV||={});function PV(e){if(!e)if(KB){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),xV(e)}const FV=/^[^#]+#/;function IV(e,t){return e.replace(FV,`#`)+t}function LV(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const RV=()=>({left:window.scrollX,top:window.scrollY});function zV(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=LV(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function BV(e,t){let n=history.state?history.state.position-t:-1;return n+e}const VV=new Map;function HV(e,t){VV.set(e,t)}function UV(e){let t=VV.get(e);return VV.delete(e),t}let WV=()=>location.protocol+`//`+location.host;function GV(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),wV(n,``)}let o=wV(n,e);return o+r+i}function KV(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=GV(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:MV.pop,direction:u?u>0?NV.forward:NV.back:NV.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){let{history:e}=window;e.state&&e.replaceState(YB({},e.state,{scroll:RV()}),``)}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`beforeunload`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`beforeunload`,u,{passive:!0}),{pauseListeners:c,listen:l,destroy:d}}function qV(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?RV():null}}function JV(e){let{history:t,location:n}=window,r={value:GV(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:WV()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){let o=YB({},t.state,qV(i.value.back,e,i.value.forward,!0),n,{position:i.value.position});a(e,o,!0),r.value=e}function s(e,n){let o=YB({},i.value,t.state,{forward:e,scroll:RV()});a(o.current,o,!0);let s=YB({},qV(r.value,e,null),{position:o.position+1},n);a(e,s,!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function YV(e){e=PV(e);let t=JV(e),n=KV(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=YB({location:``,base:e,go:r,createHref:IV.bind(null,e)},t,n);return Object.defineProperty(i,`location`,{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,`state`,{enumerable:!0,get:()=>t.state.value}),i}function XV(e){return e=location.host?e||location.pathname+location.search:``,e.includes(`#`)||(e+=`#`),YV(e)}function ZV(e){return typeof e==`string`||e&&typeof e==`object`}function QV(e){return typeof e==`string`||typeof e==`symbol`}const $V=Symbol(``);var eH;(function(e){e[e.aborted=4]=`aborted`,e[e.cancelled=8]=`cancelled`,e[e.duplicated=16]=`duplicated`})(eH||={});function tH(e,t){return YB(Error(),{type:e,[$V]:!0},t)}function nH(e,t){return e instanceof Error&&$V in e&&(t==null||!!(e.type&t))}const rH=`[^/]+?`,iH={sensitive:!1,strict:!1,start:!0,end:!0},aH=/[.+*?^${}()[\]/\\]/g;function oH(e,t){let n=YB({},iH,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;rt.length?t.length===1&&t[0]===80?1:-1:0}function cH(e,t){let n=0,r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}const uH={type:0,value:``},dH=/[a-zA-Z0-9_]/;function fH(e){if(!e)return[[]];if(e===`/`)return[[uH]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),l=``)}function f(){l+=c}for(;s{o(f)}:ZB}function o(e){if(QV(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=xH(e,n);n.splice(t,0,e),e.record.name&&!vH(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw tH(1,{location:e});s=i.record.name,a=YB(hH(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&hH(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw tH(1,{location:e,currentLocation:t});s=i.record.name,a=YB({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:yH(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function hH(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function gH(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:_H(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,`mods`,{value:{}}),t}function _H(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function vH(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function yH(e){return e.reduce((e,t)=>YB(e,t.meta),{})}function bH(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}function xH(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1,a=cH(e,t[i]);a<0?r=i:n=i+1}let i=SH(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function SH(e){let t=e;for(;t=t.parent;)if(CH(t)&&cH(e,t)===0)return t}function CH({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function wH(e){let t={};if(e===``||e===`?`)return t;let n=e[0]===`?`,r=(n?e.slice(1):e).split(`&`);for(let e=0;ee&&hV(e)):[r&&hV(r)];i.forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function EH(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=QB(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}const DH=Symbol(``),OH=Symbol(``),kH=Symbol(``),AH=Symbol(``),jH=Symbol(``);function MH(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function NH(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(tH(4,{from:n,to:t})):e instanceof Error?c(e):ZV(e)?c(tH(2,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function PH(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(t!==`beforeRouteEnter`&&!o.instances[e])continue;if(qB(s)){let c=s.__vccOpts||s,l=c[t];l&&a.push(NH(l,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=JB(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=s.__vccOpts||s,l=c[t];return l&&NH(l,n,r,o,e,i)()}))}}return a}function FH(e){let t=Zi(kH),n=Zi(AH),r=!1,i=null,a=H(()=>{let n=_n(e.to);return t.resolve(n)}),o=H(()=>{let{matched:e}=a.value,{length:t}=e,r=e[t-1],i=n.matched;if(!r||!i.length)return-1;let o=i.findIndex(EV.bind(null,r));if(o>-1)return o;let s=VH(e[t-2]);return t>1&&VH(r)===s&&i[i.length-1].path!==s?i.findIndex(EV.bind(null,e[t-2])):o}),s=H(()=>o.value>-1&&BH(n.params,a.value.params)),c=H(()=>o.value>-1&&o.value===n.matched.length-1&&DV(n.params,a.value.params));function l(n={}){if(zH(n)){let n=t[_n(e.replace)?`replace`:`push`](_n(e.to)).catch(ZB);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:a,href:H(()=>a.value.href),isActive:s,isExactActive:c,navigate:l}}function IH(e){return e.length===1?e[0]:e}const LH=Rr({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:FH,setup(e,{slots:t}){let n=$t(FH(e)),{options:r}=Zi(kH),i=H(()=>({[HH(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[HH(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&IH(t.default(n));return e.custom?r:Jo(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}}),RH=LH;function zH(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function BH(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!QB(i)||i.length!==r.length||r.some((e,t)=>e!==i[t]))return!1}return!0}function VH(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}const HH=(e,t,n)=>e??t??n,UH=Rr({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=Zi(jH),i=H(()=>e.route||r.value),a=Zi(OH,0),o=H(()=>{let e=_n(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),s=H(()=>i.value.matched[o.value]);Xi(OH,H(()=>o.value+1)),Xi(DH,s),Xi(jH,i);let c=R();return V(()=>[c.value,s.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!EV(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,a=e.name,o=s.value,l=o&&o.components[a];if(!l)return WH(n.default,{Component:l,route:r});let u=o.props[a],d=u?u===!0?r.params:typeof u==`function`?u(r):u:null,f=e=>{e.component.isUnmounted&&(o.instances[a]=null)},p=Jo(l,YB({},d,t,{onVnodeUnmounted:f,ref:c}));return WH(n.default,{Component:p,route:r})||p}}});function WH(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}const GH=UH;function KH(e){let t=mH(e.routes,e),n=e.parseQuery||wH,r=e.stringifyQuery||TH,i=e.history,a=MH(),o=MH(),s=MH(),c=z(jV),l=jV;KB&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let u=XB.bind(null,e=>``+e),d=XB.bind(null,vV),f=XB.bind(null,yV);function p(e,n){let r,i;return QV(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function m(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function h(){return t.getRoutes().map(e=>e.record)}function g(e){return!!t.getRecordMatcher(e)}function _(e,a){if(a=YB({},a||c.value),typeof e==`string`){let r=SV(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return YB(r,o,{params:f(o.params),hash:yV(r.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=YB({},e,{path:SV(n,e.path,a.path).path});else{let t=YB({},e.params);for(let e in t)t[e]??delete t[e];o=YB({},e,{params:d(t)}),a.params=d(a.params)}let s=t.resolve(o,a),l=e.hash||``;s.params=u(f(s.params));let p=CV(r,YB({},e,{hash:mV(l),path:s.path})),m=i.createHref(p);return YB({fullPath:p,hash:l,query:r===TH?EH(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function v(e){return typeof e==`string`?SV(n,e,c.value.path):YB({},e)}function y(e,t){if(l!==e)return tH(8,{from:t,to:e})}function b(e){return C(e)}function x(e){return b(YB(v(e),{replace:!0}))}function S(e){let t=e.matched[e.matched.length-1];if(t&&t.redirect){let{redirect:n}=t,r=typeof n==`function`?n(e):n;return typeof r==`string`&&(r=r.includes(`?`)||r.includes(`#`)?r=v(r):{path:r},r.params={}),YB({query:e.query,hash:e.hash,params:r.path==null?e.params:{}},r)}}function C(e,t){let n=l=_(e),i=c.value,a=e.state,o=e.force,s=e.replace===!0,u=S(n);if(u)return C(YB(v(u),{state:typeof u==`object`?YB({},a,u.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&TV(r,i,n)&&(f=tH(16,{to:d,from:i}),ne(i,i,!0,!1)),(f?Promise.resolve(f):E(d,i)).catch(e=>nH(e)?nH(e,2)?e:P(e):ee(e,d,i)).then(e=>{if(e){if(nH(e,2))return C(YB({replace:s},v(e.to),{state:typeof e.to==`object`?YB({},a,e.to.state):a,force:o}),t||d)}else e=O(d,i,!0,s,a);return D(d,i,e),e})}function w(e,t){let n=y(e,t);return n?Promise.reject(n):Promise.resolve()}function T(e){let t=ae.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function E(e,t){let n,[r,i,s]=qH(e,t);n=PH(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(NH(r,e,t))});let c=w.bind(null,e,t);return n.push(c),se(n).then(()=>{n=[];for(let r of a.list())n.push(NH(r,e,t));return n.push(c),se(n)}).then(()=>{n=PH(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(NH(r,e,t))});return n.push(c),se(n)}).then(()=>{n=[];for(let r of s)if(r.beforeEnter)if(QB(r.beforeEnter))for(let i of r.beforeEnter)n.push(NH(i,e,t));else n.push(NH(r.beforeEnter,e,t));return n.push(c),se(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=PH(s,`beforeRouteEnter`,e,t,T),n.push(c),se(n))).then(()=>{n=[];for(let r of o.list())n.push(NH(r,e,t));return n.push(c),se(n)}).catch(e=>nH(e,8)?e:Promise.reject(e))}function D(e,t,n){s.list().forEach(r=>T(()=>r(e,t,n)))}function O(e,t,n,r,a){let o=y(e,t);if(o)return o;let s=t===jV,l=KB?history.state:{};n&&(r||s?i.replace(e.fullPath,YB({scroll:s&&l&&l.scroll},a)):i.push(e.fullPath,a)),c.value=e,ne(e,t,n,s),P()}let k;function A(){k||=i.listen((e,t,n)=>{if(!oe.listening)return;let r=_(e),a=S(r);if(a){C(YB(a,{replace:!0,force:!0}),r).catch(ZB);return}l=r;let o=c.value;KB&&HV(BV(o.fullPath,n.delta),RV()),E(r,o).catch(e=>nH(e,12)?e:nH(e,2)?(C(YB(v(e.to),{force:!0}),r).then(e=>{nH(e,20)&&!n.delta&&n.type===MV.pop&&i.go(-1,!1)}).catch(ZB),Promise.reject()):(n.delta&&i.go(-n.delta,!1),ee(e,r,o))).then(e=>{e||=O(r,o,!1),e&&(n.delta&&!nH(e,8)?i.go(-n.delta,!1):n.type===MV.pop&&nH(e,20)&&i.go(-1,!1)),D(r,o,e)}).catch(ZB)})}let j=MH(),M=MH(),N;function ee(e,t,n){P(e);let r=M.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function te(){return N&&c.value!==jV?Promise.resolve():new Promise((e,t)=>{j.add([e,t])})}function P(e){return N||(N=!e,A(),j.list().forEach(([t,n])=>e?n(e):t()),j.reset()),e}function ne(t,n,r,i){let{scrollBehavior:a}=e;if(!KB||!a)return Promise.resolve();let o=!r&&UV(BV(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return Kn().then(()=>a(t,n,o)).then(e=>e&&zV(e)).catch(e=>ee(e,t,n))}let re=e=>i.go(e),ie,ae=new Set,oe={currentRoute:c,listening:!0,addRoute:p,removeRoute:m,clearRoutes:t.clearRoutes,hasRoute:g,getRoutes:h,resolve:_,options:e,push:b,replace:x,go:re,back:()=>re(-1),forward:()=>re(1),beforeEach:a.add,beforeResolve:o.add,afterEach:s.add,onError:M.add,isReady:te,install(e){let t=this;e.component(`RouterLink`,RH),e.component(`RouterView`,GH),e.config.globalProperties.$router=t,Object.defineProperty(e.config.globalProperties,`$route`,{enumerable:!0,get:()=>_n(c)}),KB&&!ie&&c.value===jV&&(ie=!0,b(i.location).catch(e=>{}));let n={};for(let e in jV)Object.defineProperty(n,e,{get:()=>c.value[e],enumerable:!0});e.provide(kH,t),e.provide(AH,en(n)),e.provide(jH,c);let r=e.unmount;ae.add(e),e.unmount=function(){ae.delete(e),ae.size<1&&(l=jV,k&&k(),k=null,c.value=jV,ie=!1,N=!1),r()}}};function se(e){return e.reduce((e,t)=>e.then(()=>T(t)),Promise.resolve())}return oe}function qH(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;oEV(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>EV(e,s))||i.push(s))}return[n,r,i]}function JH(){return Zi(kH)}function YH(e){return Zi(AH)}const XH=[{path:`/`,name:`/`,component:()=>Y(()=>import(`./pages-BuUyaRGx.js`),__vite__mapDeps([22,23,24])),meta:{layout:`home`}},{path:`/:all(.*)`,name:`/[...all]`,component:()=>Y(()=>import(`./_...all_-B_osODv_.js`),[])},{path:`/audio`,name:`/audio`,component:()=>Y(()=>import(`./audio-DlHM02zp.js`),[])},{path:`/devtools`,children:[{path:`background-remove`,name:`/devtools/background-remove`,component:()=>Y(()=>import(`./background-remove-BBVN5gMF.js`),__vite__mapDeps([25,7,8,12,26]))},{path:`chat`,name:`/devtools/chat`,component:()=>Y(()=>import(`./chat-6NJMDnl7.js`),__vite__mapDeps([27,11]))},{path:`image`,name:`/devtools/image`,component:()=>Y(()=>import(`./image-Dpb9pDE7.js`),__vite__mapDeps([28,29]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>Y(()=>import(`./polaroid-DbFi6Mzo.js`),__vite__mapDeps([30,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>Y(()=>import(`./vibrant-CBTz7DBe.js`),__vite__mapDeps([31,7,8,32,26]))}]},{path:`/queue`,name:`/queue`,component:()=>Y(()=>import(`./queue-NqCetSQS.js`),__vite__mapDeps([33,17,15]))},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>Y(()=>import(`./settings-Bw5r_FJh.js`),__vite__mapDeps([34,23,35,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>Y(()=>import(`./airi-card-gp_HXphd.js`),__vite__mapDeps([36,23,37,38,7,8,39,10,9,11,12,13,14,15,16,17,18,19,20,40,41,42,43,4,5,6,21,26])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>Y(()=>import(`./CardCreate-93Vgljnn.js`),__vite__mapDeps([44,37]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>Y(()=>import(`./CardCreationDialog-DOEDNVJJ.js`),__vite__mapDeps([45,38,7,8,39,10,9,11,12,13,14,15,16,17,18,19,20,40,4,5,6,21]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>Y(()=>import(`./CardDetailDialog-McUMnIHp.js`),__vite__mapDeps([46,41,42,39,7,8,19,20,10,9,11,12,13,14,15,16,17,18,4,5,6,21]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>Y(()=>import(`./CardListItem-KoeisllI.js`),__vite__mapDeps([47,43,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>Y(()=>import(`./DeleteCardDialog-ChdXAy_R.js`),__vite__mapDeps([48,42,39,7,8,19,20]))}]}]},{path:`appearance`,children:[{path:``,name:`/settings/appearance/`,component:()=>Y(()=>import(`./appearance-B6qqUE9Q.js`),__vite__mapDeps([49,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/appearance/color-scheme`,component:()=>Y(()=>import(`./color-scheme-BB8LYAOa.js`),__vite__mapDeps([50,23,51,39,7,8,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,52])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/appearance/developer`,component:()=>Y(()=>import(`./developer-Dt-sXJ7n.js`),__vite__mapDeps([53,23,54,17,9,10,11,12,13,14,15,16,18])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/appearance/general`,component:()=>Y(()=>import(`./general-CsrImEU_.js`),__vite__mapDeps([55,23,54,17,9,10,11,12,13,14,15,16,18])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>Y(()=>import(`./memory-DrUUBYPC.js`),__vite__mapDeps([56,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>Y(()=>import(`./models-BJIpJbS2.js`),__vite__mapDeps([57,23,35,51,39,7,8,58,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,32,59])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>Y(()=>import(`./modules-oFdrgpO7.js`),__vite__mapDeps([60,23,35,58,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>Y(()=>import(`./consciousness-NuFD6MD2.js`),__vite__mapDeps([61,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>Y(()=>import(`./memory-long-term-DUBmUqi4.js`),__vite__mapDeps([62,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>Y(()=>import(`./memory-short-term-wHAWQOw0.js`),__vite__mapDeps([63,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>Y(()=>import(`./speech-CjA8Vt_G.js`),__vite__mapDeps([64,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,65,66])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>Y(()=>import(`./providers-B-S3_fuC.js`),__vite__mapDeps([67,23,35,58,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`alibaba-cloud-model-studio`,name:`/settings/providers/alibaba-cloud-model-studio`,component:()=>Y(()=>import(`./alibaba-cloud-model-studio-BPpbwzjz.js`),__vite__mapDeps([68,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`anthropic`,name:`/settings/providers/anthropic`,component:()=>Y(()=>import(`./anthropic-D6Mj8Jul.js`),__vite__mapDeps([69,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/cloudflare-workers-ai`,component:()=>Y(()=>import(`./cloudflare-workers-ai-C4yLEnia.js`),__vite__mapDeps([70,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`deepseek`,name:`/settings/providers/deepseek`,component:()=>Y(()=>import(`./deepseek-BqMiLukk.js`),__vite__mapDeps([71,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/elevenlabs`,component:()=>Y(()=>import(`./elevenlabs-3r9LKRu7.js`),__vite__mapDeps([72,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`featherless-ai`,name:`/settings/providers/featherless-ai`,component:()=>Y(()=>import(`./featherless-ai-jAdyMyy3.js`),__vite__mapDeps([73,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`fireworks-ai`,name:`/settings/providers/fireworks-ai`,component:()=>Y(()=>import(`./fireworks-ai-Bi6np0qU.js`),__vite__mapDeps([74,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`google-generative-ai`,name:`/settings/providers/google-generative-ai`,component:()=>Y(()=>import(`./google-generative-ai-C9ebffYb.js`),__vite__mapDeps([75,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/microsoft-speech`,component:()=>Y(()=>import(`./microsoft-speech-D91uNSKl.js`),__vite__mapDeps([76,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`mistral-ai`,name:`/settings/providers/mistral-ai`,component:()=>Y(()=>import(`./mistral-ai-B6ubU7d4.js`),__vite__mapDeps([77,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`moonshot-ai`,name:`/settings/providers/moonshot-ai`,component:()=>Y(()=>import(`./moonshot-ai-Gb1o961w.js`),__vite__mapDeps([78,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`novita-ai`,name:`/settings/providers/novita-ai`,component:()=>Y(()=>import(`./novita-ai-DZ-Vz6US.js`),__vite__mapDeps([79,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/ollama`,component:()=>Y(()=>import(`./ollama-NSTufMsI.js`),__vite__mapDeps([80,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai`,name:`/settings/providers/openai`,component:()=>Y(()=>import(`./openai-CRDWRKN8.js`),__vite__mapDeps([81,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/openai-audio-speech`,component:()=>Y(()=>import(`./openai-audio-speech-CstZTITX.js`),__vite__mapDeps([82,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/openai-audio-transcription`,component:()=>Y(()=>import(`./openai-audio-transcription-IjkiOEt-.js`),__vite__mapDeps([83,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openrouter-ai`,name:`/settings/providers/openrouter-ai`,component:()=>Y(()=>import(`./openrouter-ai-mKjCEqCW.js`),__vite__mapDeps([84,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-api`,name:`/settings/providers/player2-api`,component:()=>Y(()=>import(`./player2-api-DYzC8-m3.js`),__vite__mapDeps([85,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`together-ai`,name:`/settings/providers/together-ai`,component:()=>Y(()=>import(`./together-ai-DnlRcpSP.js`),__vite__mapDeps([86,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/volcengine`,component:()=>Y(()=>import(`./volcengine-CUaCa6hT.js`),__vite__mapDeps([87,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`xai`,name:`/settings/providers/xai`,component:()=>Y(()=>import(`./xai-CvGLXM75.js`),__vite__mapDeps([88,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>Y(()=>import(`./scene-sC31UkJB.js`),__vite__mapDeps([89,23,35,58,17,9,10,11,12,13,14,15,16,18])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]}]},{path:`/stage`,children:[{path:``,name:`/stage/`,component:()=>Y(()=>import(`./stage-BkAPr8zf.js`),__vite__mapDeps([90,23,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,65,91])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}}]},{path:`/test`,children:[{path:`filter-message`,name:`/test/filter-message`,component:()=>Y(()=>import(`./filter-message-C1Dba7ss.js`),__vite__mapDeps([92,7,8,17,65,66]))},{path:`queues`,children:[{path:`delays`,name:`/test/queues/delays`,component:()=>Y(()=>import(`./delays-DVvIZeUS.js`),__vite__mapDeps([93,7,8,17,9,15,16,65,66]))},{path:`emotions`,name:`/test/queues/emotions`,component:()=>Y(()=>import(`./emotions-SSc0a-LV.js`),__vite__mapDeps([94,7,8,17,15,16,65,66]))},{path:`messages`,name:`/test/queues/messages`,component:()=>Y(()=>import(`./messages-BWcBoWro.js`),__vite__mapDeps([95,7,8,17,15,16,65,66]))}]}]}],ZH=(e,t)=>{if(typeof e==`number`){if(t===3)return{mode:`rgb`,r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:`rgb`,r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:`rgb`,r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:`rgb`,r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}};var QH=ZH;const $H={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};var eU=$H;const tU=e=>QH(eU[e.toLowerCase()],6);var nU=tU;const rU=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,iU=e=>{let t;return(t=e.match(rU))?QH(parseInt(t[1],16),t[1].length):void 0};var aU=iU;const oU=`([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)`,sU=`(?:${oU}|none)`,cU=`${oU}%`,lU=`(?:${oU}%|none)`,uU=`(?:${oU}%|${oU})`,dU=`(?:${oU}%|${oU}|none)`,fU=`(?:${oU}(deg|grad|rad|turn)|${oU})`,pU=`(?:${oU}(deg|grad|rad|turn)|${oU}|none)`,mU=`\\s*,\\s*`,hU=RegExp(`^`+dU+`$`),gU=RegExp(`^rgba?\\(\\s*${oU}${mU}${oU}${mU}${oU}\\s*(?:,\\s*${uU}\\s*)?\\)$`),_U=RegExp(`^rgba?\\(\\s*${cU}${mU}${cU}${mU}${cU}\\s*(?:,\\s*${uU}\\s*)?\\)$`),vU=e=>{let t={mode:`rgb`},n;if(n=e.match(gU))n[1]!==void 0&&(t.r=n[1]/255),n[2]!==void 0&&(t.g=n[2]/255),n[3]!==void 0&&(t.b=n[3]/255);else if(n=e.match(_U))n[1]!==void 0&&(t.r=n[1]/100),n[2]!==void 0&&(t.g=n[2]/100),n[3]!==void 0&&(t.b=n[3]/100);else return;return n[4]===void 0?n[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+n[5]))):t.alpha=Math.max(0,Math.min(1,n[4]/100)),t};var yU=vU;const bU=(e,t)=>e===void 0?void 0:typeof e==`object`?e.mode===void 0?t?{...e,mode:t}:void 0:e:KU(e);var xU=bU;const SU=(e=`rgb`)=>t=>(t=xU(t,e))===void 0?void 0:t.mode===e?t:wU[t.mode][e]?wU[t.mode][e](t):e===`rgb`?wU[t.mode].rgb(t):wU.rgb[e](wU[t.mode].rgb(t));var CU=SU;const wU={},TU={},EU=[],DU={},OU=e=>e,kU=e=>(wU[e.mode]={...wU[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{wU[t]||(wU[t]={}),wU[t][e.mode]=e.fromMode[t]}),e.ranges||={},e.difference||={},e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]==`function`&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=OU)}),TU[e.mode]=e,(e.parse||[]).forEach(t=>{jU(t,e.mode)}),CU(e.mode)),AU=e=>TU[e],jU=(e,t)=>{if(typeof e==`string`){if(!t)throw Error(`'mode' required when 'parser' is a string`);DU[e]=t}else typeof e==`function`&&EU.indexOf(e)<0&&EU.push(e)},MU=/[^\x00-\x7F]|[a-zA-Z_]/,NU=/[^\x00-\x7F]|[-\w]/,X={Function:`function`,Ident:`ident`,Number:`number`,Percentage:`percentage`,ParenClose:`)`,None:`none`,Hue:`hue`,Alpha:`alpha`};let Z=0;function PU(e){let t=e[Z],n=e[Z+1];return t===`-`||t===`+`?/\d/.test(n)||n===`.`&&/\d/.test(e[Z+2]):t===`.`?/\d/.test(n):/\d/.test(t)}function FU(e){if(Z>=e.length)return!1;let t=e[Z];if(MU.test(t))return!0;if(t===`-`){if(e.length-Z<2)return!1;let t=e[Z+1];return!!(t===`-`||MU.test(t))}return!1}const IU={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function LU(e){let t=``;if((e[Z]===`-`||e[Z]===`+`)&&(t+=e[Z++]),t+=RU(e),e[Z]===`.`&&/\d/.test(e[Z+1])&&(t+=e[Z++]+RU(e)),(e[Z]===`e`||e[Z]===`E`)&&((e[Z+1]===`-`||e[Z+1]===`+`)&&/\d/.test(e[Z+2])?t+=e[Z++]+e[Z++]+RU(e):/\d/.test(e[Z+1])&&(t+=e[Z++]+RU(e))),FU(e)){let n=zU(e);return n===`deg`||n===`rad`||n===`turn`||n===`grad`?{type:X.Hue,value:t*IU[n]}:void 0}return e[Z]===`%`?(Z++,{type:X.Percentage,value:+t}):{type:X.Number,value:+t}}function RU(e){let t=``;for(;/\d/.test(e[Z]);)t+=e[Z++];return t}function zU(e){let t=``;for(;Ze[r],set(t){e[r]=t}}):(pn(i)||an(i))&&(n[r]=Tn(e,r))}return n}const HB=`modulepreload`,UB=function(e){return`/`+e},WB={},Y=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=document.getElementsByTagName(`link`),a=document.querySelector(`meta[property=csp-nonce]`),o=a?.nonce||a?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=UB(e,n),e in WB)return;WB[e]=!0;let t=e.endsWith(`.css`),r=t?`[rel="stylesheet"]`:``,a=!!n;if(a)for(let n=i.length-1;n>=0;n--){let r=i[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${e}"]${r}`))return;let s=document.createElement(`link`);if(s.rel=t?`stylesheet`:HB,t||(s.as=`script`),s.crossOrigin=``,s.href=e,o&&s.setAttribute(`nonce`,o),document.head.appendChild(s),t)return new Promise((t,n)=>{s.addEventListener(`load`,t),s.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[]){if(e.status!==`rejected`)continue;i(e.reason)}return e().catch(i)})},GB=e=>{let t={},n=Object.assign({"/src/layouts/default.vue":()=>Y(()=>import(`./default-xnAH3KmJ.js`),__vite__mapDeps([0,1,2])),"/src/layouts/home.vue":()=>Y(()=>import(`./home-ZzY7AMxo.js`),[]),"/src/layouts/settings.vue":()=>Y(()=>import(`./settings-D1j-vsv3.js`),__vite__mapDeps([3,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),"/src/layouts/stage.vue":()=>Y(()=>import(`./stage-ClK_9YgL.js`),[])});Object.entries(n).forEach(([e,n])=>{let r=e.replace(`/src/layouts/`,``).replace(`.vue`,``);t[r]=n});function r(e,n=!0){return e.map(e=>{var i,a,o;if((i=e.children)?.length>0&&(e.children=r(e.children,!1)),n){var s,c,l;let n=!e.component&&(s=e.children)?.find(e=>{var t;return(e.path===``||e.path===`/`)&&(t=e.meta)?.isLayout});if(n)return e;if((c=e.meta)?.layout!==!1)return{path:e.path,component:t[(l=e.meta)?.layout||`default`],children:e.path===`/`?[e]:[{...e,path:``}],meta:{isLayout:!0}}}return(a=e.meta)?.layout?{path:e.path,component:t[(o=e.meta)?.layout],children:[{...e,path:``}],meta:{isLayout:!0}}:e})}return r(e)},KB=typeof document<`u`;function qB(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function JB(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&qB(e.default)}const YB=Object.assign;function XB(e,t){let n={};for(let r in t){let i=t[r];n[r]=QB(i)?i.map(e):e(i)}return n}const ZB=()=>{},QB=Array.isArray,$B=/#/g,eV=/&/g,tV=/\//g,nV=/=/g,rV=/\?/g,iV=/\+/g,aV=/%5B/g,oV=/%5D/g,sV=/%5E/g,cV=/%60/g,lV=/%7B/g,uV=/%7C/g,dV=/%7D/g,fV=/%20/g;function pV(e){return encodeURI(``+e).replace(uV,`|`).replace(aV,`[`).replace(oV,`]`)}function mV(e){return pV(e).replace(lV,`{`).replace(dV,`}`).replace(sV,`^`)}function hV(e){return pV(e).replace(iV,`%2B`).replace(fV,`+`).replace($B,`%23`).replace(eV,`%26`).replace(cV,"`").replace(lV,`{`).replace(dV,`}`).replace(sV,`^`)}function gV(e){return hV(e).replace(nV,`%3D`)}function _V(e){return pV(e).replace($B,`%23`).replace(rV,`%3F`)}function vV(e){return e==null?``:_V(e).replace(tV,`%2F`)}function yV(e){try{return decodeURIComponent(``+e)}catch{}return``+e}const bV=/\/$/,xV=e=>e.replace(bV,``);function SV(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return s=0&&(c=-1),c>-1&&(r=t.slice(0,c),a=t.slice(c+1,s>-1?s:t.length),i=e(a)),s>-1&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=AV(r??t,n),{fullPath:r+(a&&`?`)+a+o,path:r,query:i,hash:yV(o)}}function CV(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function wV(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function TV(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&EV(t.matched[r],n.matched[i])&&DV(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function EV(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function DV(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!OV(e[n],t[n]))return!1;return!0}function OV(e,t){return QB(e)?kV(e,t):QB(t)?kV(t,e):e===t}function kV(e,t){return QB(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function AV(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}const jV={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};var MV;(function(e){e.pop=`pop`,e.push=`push`})(MV||={});var NV;(function(e){e.back=`back`,e.forward=`forward`,e.unknown=``})(NV||={});function PV(e){if(!e)if(KB){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),xV(e)}const FV=/^[^#]+#/;function IV(e,t){return e.replace(FV,`#`)+t}function LV(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const RV=()=>({left:window.scrollX,top:window.scrollY});function zV(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=LV(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function BV(e,t){let n=history.state?history.state.position-t:-1;return n+e}const VV=new Map;function HV(e,t){VV.set(e,t)}function UV(e){let t=VV.get(e);return VV.delete(e),t}let WV=()=>location.protocol+`//`+location.host;function GV(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),wV(n,``)}let o=wV(n,e);return o+r+i}function KV(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=GV(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:MV.pop,direction:u?u>0?NV.forward:NV.back:NV.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){let{history:e}=window;e.state&&e.replaceState(YB({},e.state,{scroll:RV()}),``)}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`beforeunload`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`beforeunload`,u,{passive:!0}),{pauseListeners:c,listen:l,destroy:d}}function qV(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?RV():null}}function JV(e){let{history:t,location:n}=window,r={value:GV(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:WV()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){let o=YB({},t.state,qV(i.value.back,e,i.value.forward,!0),n,{position:i.value.position});a(e,o,!0),r.value=e}function s(e,n){let o=YB({},i.value,t.state,{forward:e,scroll:RV()});a(o.current,o,!0);let s=YB({},qV(r.value,e,null),{position:o.position+1},n);a(e,s,!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function YV(e){e=PV(e);let t=JV(e),n=KV(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=YB({location:``,base:e,go:r,createHref:IV.bind(null,e)},t,n);return Object.defineProperty(i,`location`,{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,`state`,{enumerable:!0,get:()=>t.state.value}),i}function XV(e){return e=location.host?e||location.pathname+location.search:``,e.includes(`#`)||(e+=`#`),YV(e)}function ZV(e){return typeof e==`string`||e&&typeof e==`object`}function QV(e){return typeof e==`string`||typeof e==`symbol`}const $V=Symbol(``);var eH;(function(e){e[e.aborted=4]=`aborted`,e[e.cancelled=8]=`cancelled`,e[e.duplicated=16]=`duplicated`})(eH||={});function tH(e,t){return YB(Error(),{type:e,[$V]:!0},t)}function nH(e,t){return e instanceof Error&&$V in e&&(t==null||!!(e.type&t))}const rH=`[^/]+?`,iH={sensitive:!1,strict:!1,start:!0,end:!0},aH=/[.+*?^${}()[\]/\\]/g;function oH(e,t){let n=YB({},iH,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;rt.length?t.length===1&&t[0]===80?1:-1:0}function cH(e,t){let n=0,r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}const uH={type:0,value:``},dH=/[a-zA-Z0-9_]/;function fH(e){if(!e)return[[]];if(e===`/`)return[[uH]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),l=``)}function f(){l+=c}for(;s{o(f)}:ZB}function o(e){if(QV(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=xH(e,n);n.splice(t,0,e),e.record.name&&!vH(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw tH(1,{location:e});s=i.record.name,a=YB(hH(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&hH(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw tH(1,{location:e,currentLocation:t});s=i.record.name,a=YB({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:yH(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function hH(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function gH(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:_H(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,`mods`,{value:{}}),t}function _H(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function vH(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function yH(e){return e.reduce((e,t)=>YB(e,t.meta),{})}function bH(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}function xH(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1,a=cH(e,t[i]);a<0?r=i:n=i+1}let i=SH(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function SH(e){let t=e;for(;t=t.parent;)if(CH(t)&&cH(e,t)===0)return t}function CH({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function wH(e){let t={};if(e===``||e===`?`)return t;let n=e[0]===`?`,r=(n?e.slice(1):e).split(`&`);for(let e=0;ee&&hV(e)):[r&&hV(r)];i.forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function EH(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=QB(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}const DH=Symbol(``),OH=Symbol(``),kH=Symbol(``),AH=Symbol(``),jH=Symbol(``);function MH(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function NH(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(tH(4,{from:n,to:t})):e instanceof Error?c(e):ZV(e)?c(tH(2,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function PH(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(t!==`beforeRouteEnter`&&!o.instances[e])continue;if(qB(s)){let c=s.__vccOpts||s,l=c[t];l&&a.push(NH(l,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=JB(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=s.__vccOpts||s,l=c[t];return l&&NH(l,n,r,o,e,i)()}))}}return a}function FH(e){let t=Zi(kH),n=Zi(AH),r=!1,i=null,a=H(()=>{let n=_n(e.to);return t.resolve(n)}),o=H(()=>{let{matched:e}=a.value,{length:t}=e,r=e[t-1],i=n.matched;if(!r||!i.length)return-1;let o=i.findIndex(EV.bind(null,r));if(o>-1)return o;let s=VH(e[t-2]);return t>1&&VH(r)===s&&i[i.length-1].path!==s?i.findIndex(EV.bind(null,e[t-2])):o}),s=H(()=>o.value>-1&&BH(n.params,a.value.params)),c=H(()=>o.value>-1&&o.value===n.matched.length-1&&DV(n.params,a.value.params));function l(n={}){if(zH(n)){let n=t[_n(e.replace)?`replace`:`push`](_n(e.to)).catch(ZB);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:a,href:H(()=>a.value.href),isActive:s,isExactActive:c,navigate:l}}function IH(e){return e.length===1?e[0]:e}const LH=Rr({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:FH,setup(e,{slots:t}){let n=$t(FH(e)),{options:r}=Zi(kH),i=H(()=>({[HH(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[HH(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&IH(t.default(n));return e.custom?r:Jo(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}}),RH=LH;function zH(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function BH(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!QB(i)||i.length!==r.length||r.some((e,t)=>e!==i[t]))return!1}return!0}function VH(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}const HH=(e,t,n)=>e??t??n,UH=Rr({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=Zi(jH),i=H(()=>e.route||r.value),a=Zi(OH,0),o=H(()=>{let e=_n(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),s=H(()=>i.value.matched[o.value]);Xi(OH,H(()=>o.value+1)),Xi(DH,s),Xi(jH,i);let c=R();return V(()=>[c.value,s.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!EV(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,a=e.name,o=s.value,l=o&&o.components[a];if(!l)return WH(n.default,{Component:l,route:r});let u=o.props[a],d=u?u===!0?r.params:typeof u==`function`?u(r):u:null,f=e=>{e.component.isUnmounted&&(o.instances[a]=null)},p=Jo(l,YB({},d,t,{onVnodeUnmounted:f,ref:c}));return WH(n.default,{Component:p,route:r})||p}}});function WH(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}const GH=UH;function KH(e){let t=mH(e.routes,e),n=e.parseQuery||wH,r=e.stringifyQuery||TH,i=e.history,a=MH(),o=MH(),s=MH(),c=z(jV),l=jV;KB&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let u=XB.bind(null,e=>``+e),d=XB.bind(null,vV),f=XB.bind(null,yV);function p(e,n){let r,i;return QV(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function m(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function h(){return t.getRoutes().map(e=>e.record)}function g(e){return!!t.getRecordMatcher(e)}function _(e,a){if(a=YB({},a||c.value),typeof e==`string`){let r=SV(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return YB(r,o,{params:f(o.params),hash:yV(r.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=YB({},e,{path:SV(n,e.path,a.path).path});else{let t=YB({},e.params);for(let e in t)t[e]??delete t[e];o=YB({},e,{params:d(t)}),a.params=d(a.params)}let s=t.resolve(o,a),l=e.hash||``;s.params=u(f(s.params));let p=CV(r,YB({},e,{hash:mV(l),path:s.path})),m=i.createHref(p);return YB({fullPath:p,hash:l,query:r===TH?EH(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function v(e){return typeof e==`string`?SV(n,e,c.value.path):YB({},e)}function y(e,t){if(l!==e)return tH(8,{from:t,to:e})}function b(e){return C(e)}function x(e){return b(YB(v(e),{replace:!0}))}function S(e){let t=e.matched[e.matched.length-1];if(t&&t.redirect){let{redirect:n}=t,r=typeof n==`function`?n(e):n;return typeof r==`string`&&(r=r.includes(`?`)||r.includes(`#`)?r=v(r):{path:r},r.params={}),YB({query:e.query,hash:e.hash,params:r.path==null?e.params:{}},r)}}function C(e,t){let n=l=_(e),i=c.value,a=e.state,o=e.force,s=e.replace===!0,u=S(n);if(u)return C(YB(v(u),{state:typeof u==`object`?YB({},a,u.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&TV(r,i,n)&&(f=tH(16,{to:d,from:i}),ne(i,i,!0,!1)),(f?Promise.resolve(f):E(d,i)).catch(e=>nH(e)?nH(e,2)?e:P(e):ee(e,d,i)).then(e=>{if(e){if(nH(e,2))return C(YB({replace:s},v(e.to),{state:typeof e.to==`object`?YB({},a,e.to.state):a,force:o}),t||d)}else e=O(d,i,!0,s,a);return D(d,i,e),e})}function w(e,t){let n=y(e,t);return n?Promise.reject(n):Promise.resolve()}function T(e){let t=ae.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function E(e,t){let n,[r,i,s]=qH(e,t);n=PH(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(NH(r,e,t))});let c=w.bind(null,e,t);return n.push(c),se(n).then(()=>{n=[];for(let r of a.list())n.push(NH(r,e,t));return n.push(c),se(n)}).then(()=>{n=PH(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(NH(r,e,t))});return n.push(c),se(n)}).then(()=>{n=[];for(let r of s)if(r.beforeEnter)if(QB(r.beforeEnter))for(let i of r.beforeEnter)n.push(NH(i,e,t));else n.push(NH(r.beforeEnter,e,t));return n.push(c),se(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=PH(s,`beforeRouteEnter`,e,t,T),n.push(c),se(n))).then(()=>{n=[];for(let r of o.list())n.push(NH(r,e,t));return n.push(c),se(n)}).catch(e=>nH(e,8)?e:Promise.reject(e))}function D(e,t,n){s.list().forEach(r=>T(()=>r(e,t,n)))}function O(e,t,n,r,a){let o=y(e,t);if(o)return o;let s=t===jV,l=KB?history.state:{};n&&(r||s?i.replace(e.fullPath,YB({scroll:s&&l&&l.scroll},a)):i.push(e.fullPath,a)),c.value=e,ne(e,t,n,s),P()}let k;function A(){k||=i.listen((e,t,n)=>{if(!oe.listening)return;let r=_(e),a=S(r);if(a){C(YB(a,{replace:!0,force:!0}),r).catch(ZB);return}l=r;let o=c.value;KB&&HV(BV(o.fullPath,n.delta),RV()),E(r,o).catch(e=>nH(e,12)?e:nH(e,2)?(C(YB(v(e.to),{force:!0}),r).then(e=>{nH(e,20)&&!n.delta&&n.type===MV.pop&&i.go(-1,!1)}).catch(ZB),Promise.reject()):(n.delta&&i.go(-n.delta,!1),ee(e,r,o))).then(e=>{e||=O(r,o,!1),e&&(n.delta&&!nH(e,8)?i.go(-n.delta,!1):n.type===MV.pop&&nH(e,20)&&i.go(-1,!1)),D(r,o,e)}).catch(ZB)})}let j=MH(),M=MH(),N;function ee(e,t,n){P(e);let r=M.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function te(){return N&&c.value!==jV?Promise.resolve():new Promise((e,t)=>{j.add([e,t])})}function P(e){return N||(N=!e,A(),j.list().forEach(([t,n])=>e?n(e):t()),j.reset()),e}function ne(t,n,r,i){let{scrollBehavior:a}=e;if(!KB||!a)return Promise.resolve();let o=!r&&UV(BV(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return Kn().then(()=>a(t,n,o)).then(e=>e&&zV(e)).catch(e=>ee(e,t,n))}let re=e=>i.go(e),ie,ae=new Set,oe={currentRoute:c,listening:!0,addRoute:p,removeRoute:m,clearRoutes:t.clearRoutes,hasRoute:g,getRoutes:h,resolve:_,options:e,push:b,replace:x,go:re,back:()=>re(-1),forward:()=>re(1),beforeEach:a.add,beforeResolve:o.add,afterEach:s.add,onError:M.add,isReady:te,install(e){let t=this;e.component(`RouterLink`,RH),e.component(`RouterView`,GH),e.config.globalProperties.$router=t,Object.defineProperty(e.config.globalProperties,`$route`,{enumerable:!0,get:()=>_n(c)}),KB&&!ie&&c.value===jV&&(ie=!0,b(i.location).catch(e=>{}));let n={};for(let e in jV)Object.defineProperty(n,e,{get:()=>c.value[e],enumerable:!0});e.provide(kH,t),e.provide(AH,en(n)),e.provide(jH,c);let r=e.unmount;ae.add(e),e.unmount=function(){ae.delete(e),ae.size<1&&(l=jV,k&&k(),k=null,c.value=jV,ie=!1,N=!1),r()}}};function se(e){return e.reduce((e,t)=>e.then(()=>T(t)),Promise.resolve())}return oe}function qH(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;oEV(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>EV(e,s))||i.push(s))}return[n,r,i]}function JH(){return Zi(kH)}function YH(e){return Zi(AH)}const XH=[{path:`/`,name:`/`,component:()=>Y(()=>import(`./pages-DN0dVd_t.js`),__vite__mapDeps([22,23,24])),meta:{layout:`home`}},{path:`/:all(.*)`,name:`/[...all]`,component:()=>Y(()=>import(`./_...all_-CDWjTnYO.js`),[])},{path:`/audio`,name:`/audio`,component:()=>Y(()=>import(`./audio-C1MdKXG0.js`),[])},{path:`/devtools`,children:[{path:`background-remove`,name:`/devtools/background-remove`,component:()=>Y(()=>import(`./background-remove-DWgFP94H.js`),__vite__mapDeps([25,7,8,12,26]))},{path:`chat`,name:`/devtools/chat`,component:()=>Y(()=>import(`./chat-B0HcMONu.js`),__vite__mapDeps([27,11]))},{path:`image`,name:`/devtools/image`,component:()=>Y(()=>import(`./image--dKP-ZlZ.js`),__vite__mapDeps([28,29]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>Y(()=>import(`./polaroid-BoXbUjSB.js`),__vite__mapDeps([30,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>Y(()=>import(`./vibrant-Cho7xMN6.js`),__vite__mapDeps([31,7,8,32,26]))}]},{path:`/queue`,name:`/queue`,component:()=>Y(()=>import(`./queue-DeMWSQ3F.js`),__vite__mapDeps([33,17,15]))},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>Y(()=>import(`./settings-DWdpldbJ.js`),__vite__mapDeps([34,23,35,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>Y(()=>import(`./airi-card-B_A3U3hx.js`),__vite__mapDeps([36,23,37,38,7,8,39,9,10,11,12,13,14,15,16,17,18,19,20,40,41,42,43,4,5,6,21,26])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>Y(()=>import(`./CardCreate-DIURsdhI.js`),__vite__mapDeps([44,37]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>Y(()=>import(`./CardCreationDialog-DPBvL_ac.js`),__vite__mapDeps([45,38,7,8,39,9,10,11,12,13,14,15,16,17,18,19,20,40,4,5,6,21]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>Y(()=>import(`./CardDetailDialog-DnvIbrvr.js`),__vite__mapDeps([46,41,42,39,7,8,19,20,9,10,11,12,13,14,15,16,17,18,4,5,6,21]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>Y(()=>import(`./CardListItem-BpM5aZB-.js`),__vite__mapDeps([47,43,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>Y(()=>import(`./DeleteCardDialog-BoKcjVsa.js`),__vite__mapDeps([48,42,39,7,8,19,20]))}]}]},{path:`appearance`,children:[{path:``,name:`/settings/appearance/`,component:()=>Y(()=>import(`./appearance-t6hovndX.js`),__vite__mapDeps([49,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/appearance/color-scheme`,component:()=>Y(()=>import(`./color-scheme-DpRkLhr5.js`),__vite__mapDeps([50,23,51,39,7,8,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,52])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/appearance/developer`,component:()=>Y(()=>import(`./developer-BDrLqOcT.js`),__vite__mapDeps([53,23,54,9,10,11,12,13,14,15,16,17,18])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/appearance/general`,component:()=>Y(()=>import(`./general-DWdxQoRL.js`),__vite__mapDeps([55,23,54,9,10,11,12,13,14,15,16,17,18])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>Y(()=>import(`./memory-DkrmmiHt.js`),__vite__mapDeps([56,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>Y(()=>import(`./models-76vvgGXm.js`),__vite__mapDeps([57,23,35,51,39,7,8,58,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,32,59])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>Y(()=>import(`./modules-BnTzg3CJ.js`),__vite__mapDeps([60,23,35,58,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>Y(()=>import(`./consciousness-DGt-Az-C.js`),__vite__mapDeps([61,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>Y(()=>import(`./memory-long-term-DhH1haWG.js`),__vite__mapDeps([62,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>Y(()=>import(`./memory-short-term-ZF-2h-kI.js`),__vite__mapDeps([63,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>Y(()=>import(`./speech-Bw68A32w.js`),__vite__mapDeps([64,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,65,66])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>Y(()=>import(`./providers-CMOdvsid.js`),__vite__mapDeps([67,23,35,58,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`alibaba-cloud-model-studio`,name:`/settings/providers/alibaba-cloud-model-studio`,component:()=>Y(()=>import(`./alibaba-cloud-model-studio-DKtpBeWj.js`),__vite__mapDeps([68,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`anthropic`,name:`/settings/providers/anthropic`,component:()=>Y(()=>import(`./anthropic-DCrOC5Oo.js`),__vite__mapDeps([69,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/cloudflare-workers-ai`,component:()=>Y(()=>import(`./cloudflare-workers-ai-Cso4_BGA.js`),__vite__mapDeps([70,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`deepseek`,name:`/settings/providers/deepseek`,component:()=>Y(()=>import(`./deepseek-BzDEswlr.js`),__vite__mapDeps([71,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/elevenlabs`,component:()=>Y(()=>import(`./elevenlabs-DrNId1mR.js`),__vite__mapDeps([72,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`featherless-ai`,name:`/settings/providers/featherless-ai`,component:()=>Y(()=>import(`./featherless-ai-Ca5fPlYY.js`),__vite__mapDeps([73,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`fireworks-ai`,name:`/settings/providers/fireworks-ai`,component:()=>Y(()=>import(`./fireworks-ai-eLraL8LE.js`),__vite__mapDeps([74,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`google-generative-ai`,name:`/settings/providers/google-generative-ai`,component:()=>Y(()=>import(`./google-generative-ai-OPnnnKDe.js`),__vite__mapDeps([75,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/microsoft-speech`,component:()=>Y(()=>import(`./microsoft-speech-BzMvh9G0.js`),__vite__mapDeps([76,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`mistral-ai`,name:`/settings/providers/mistral-ai`,component:()=>Y(()=>import(`./mistral-ai-BfFFEoJ2.js`),__vite__mapDeps([77,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`moonshot-ai`,name:`/settings/providers/moonshot-ai`,component:()=>Y(()=>import(`./moonshot-ai-UFXQvwF7.js`),__vite__mapDeps([78,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`novita-ai`,name:`/settings/providers/novita-ai`,component:()=>Y(()=>import(`./novita-ai-CHDoxp4K.js`),__vite__mapDeps([79,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/ollama`,component:()=>Y(()=>import(`./ollama-cl0Rrnvz.js`),__vite__mapDeps([80,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai`,name:`/settings/providers/openai`,component:()=>Y(()=>import(`./openai-CdWtYSM3.js`),__vite__mapDeps([81,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/openai-audio-speech`,component:()=>Y(()=>import(`./openai-audio-speech-92ozaSwL.js`),__vite__mapDeps([82,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/openai-audio-transcription`,component:()=>Y(()=>import(`./openai-audio-transcription-CWLk8_6R.js`),__vite__mapDeps([83,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openrouter-ai`,name:`/settings/providers/openrouter-ai`,component:()=>Y(()=>import(`./openrouter-ai-DJ3Pwf8-.js`),__vite__mapDeps([84,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-api`,name:`/settings/providers/player2-api`,component:()=>Y(()=>import(`./player2-api-B_cW5fsP.js`),__vite__mapDeps([85,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`together-ai`,name:`/settings/providers/together-ai`,component:()=>Y(()=>import(`./together-ai-BcVdn6ff.js`),__vite__mapDeps([86,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/volcengine`,component:()=>Y(()=>import(`./volcengine-BNR9YCJ3.js`),__vite__mapDeps([87,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`xai`,name:`/settings/providers/xai`,component:()=>Y(()=>import(`./xai-CePM5sec.js`),__vite__mapDeps([88,23,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>Y(()=>import(`./scene-DrliOSzk.js`),__vite__mapDeps([89,23,35,58,9,10,11,12,13,14,15,16,17,18])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]}]},{path:`/stage`,children:[{path:``,name:`/stage/`,component:()=>Y(()=>import(`./stage-rGESOq2q.js`),__vite__mapDeps([90,23,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,65,91])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}}]},{path:`/test`,children:[{path:`filter-message`,name:`/test/filter-message`,component:()=>Y(()=>import(`./filter-message-ByGUaxmz.js`),__vite__mapDeps([92,7,8,17,65,66]))},{path:`queues`,children:[{path:`delays`,name:`/test/queues/delays`,component:()=>Y(()=>import(`./delays-DFcn4gRF.js`),__vite__mapDeps([93,7,8,10,17,15,16,65,66]))},{path:`emotions`,name:`/test/queues/emotions`,component:()=>Y(()=>import(`./emotions-EE6Y-cSt.js`),__vite__mapDeps([94,7,8,17,15,16,65,66]))},{path:`messages`,name:`/test/queues/messages`,component:()=>Y(()=>import(`./messages-ChSNCEvv.js`),__vite__mapDeps([95,7,8,17,15,16,65,66]))}]}]}],ZH=(e,t)=>{if(typeof e==`number`){if(t===3)return{mode:`rgb`,r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:`rgb`,r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:`rgb`,r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:`rgb`,r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}};var QH=ZH;const $H={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};var eU=$H;const tU=e=>QH(eU[e.toLowerCase()],6);var nU=tU;const rU=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,iU=e=>{let t;return(t=e.match(rU))?QH(parseInt(t[1],16),t[1].length):void 0};var aU=iU;const oU=`([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)`,sU=`(?:${oU}|none)`,cU=`${oU}%`,lU=`(?:${oU}%|none)`,uU=`(?:${oU}%|${oU})`,dU=`(?:${oU}%|${oU}|none)`,fU=`(?:${oU}(deg|grad|rad|turn)|${oU})`,pU=`(?:${oU}(deg|grad|rad|turn)|${oU}|none)`,mU=`\\s*,\\s*`,hU=RegExp(`^`+dU+`$`),gU=RegExp(`^rgba?\\(\\s*${oU}${mU}${oU}${mU}${oU}\\s*(?:,\\s*${uU}\\s*)?\\)$`),_U=RegExp(`^rgba?\\(\\s*${cU}${mU}${cU}${mU}${cU}\\s*(?:,\\s*${uU}\\s*)?\\)$`),vU=e=>{let t={mode:`rgb`},n;if(n=e.match(gU))n[1]!==void 0&&(t.r=n[1]/255),n[2]!==void 0&&(t.g=n[2]/255),n[3]!==void 0&&(t.b=n[3]/255);else if(n=e.match(_U))n[1]!==void 0&&(t.r=n[1]/100),n[2]!==void 0&&(t.g=n[2]/100),n[3]!==void 0&&(t.b=n[3]/100);else return;return n[4]===void 0?n[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+n[5]))):t.alpha=Math.max(0,Math.min(1,n[4]/100)),t};var yU=vU;const bU=(e,t)=>e===void 0?void 0:typeof e==`object`?e.mode===void 0?t?{...e,mode:t}:void 0:e:KU(e);var xU=bU;const SU=(e=`rgb`)=>t=>(t=xU(t,e))===void 0?void 0:t.mode===e?t:wU[t.mode][e]?wU[t.mode][e](t):e===`rgb`?wU[t.mode].rgb(t):wU.rgb[e](wU[t.mode].rgb(t));var CU=SU;const wU={},TU={},EU=[],DU={},OU=e=>e,kU=e=>(wU[e.mode]={...wU[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{wU[t]||(wU[t]={}),wU[t][e.mode]=e.fromMode[t]}),e.ranges||={},e.difference||={},e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]==`function`&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=OU)}),TU[e.mode]=e,(e.parse||[]).forEach(t=>{jU(t,e.mode)}),CU(e.mode)),AU=e=>TU[e],jU=(e,t)=>{if(typeof e==`string`){if(!t)throw Error(`'mode' required when 'parser' is a string`);DU[e]=t}else typeof e==`function`&&EU.indexOf(e)<0&&EU.push(e)},MU=/[^\x00-\x7F]|[a-zA-Z_]/,NU=/[^\x00-\x7F]|[-\w]/,X={Function:`function`,Ident:`ident`,Number:`number`,Percentage:`percentage`,ParenClose:`)`,None:`none`,Hue:`hue`,Alpha:`alpha`};let Z=0;function PU(e){let t=e[Z],n=e[Z+1];return t===`-`||t===`+`?/\d/.test(n)||n===`.`&&/\d/.test(e[Z+2]):t===`.`?/\d/.test(n):/\d/.test(t)}function FU(e){if(Z>=e.length)return!1;let t=e[Z];if(MU.test(t))return!0;if(t===`-`){if(e.length-Z<2)return!1;let t=e[Z+1];return!!(t===`-`||MU.test(t))}return!1}const IU={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function LU(e){let t=``;if((e[Z]===`-`||e[Z]===`+`)&&(t+=e[Z++]),t+=RU(e),e[Z]===`.`&&/\d/.test(e[Z+1])&&(t+=e[Z++]+RU(e)),(e[Z]===`e`||e[Z]===`E`)&&((e[Z+1]===`-`||e[Z+1]===`+`)&&/\d/.test(e[Z+2])?t+=e[Z++]+e[Z++]+RU(e):/\d/.test(e[Z+1])&&(t+=e[Z++]+RU(e))),FU(e)){let n=zU(e);return n===`deg`||n===`rad`||n===`turn`||n===`grad`?{type:X.Hue,value:t*IU[n]}:void 0}return e[Z]===`%`?(Z++,{type:X.Percentage,value:+t}):{type:X.Number,value:+t}}function RU(e){let t=``;for(;/\d/.test(e[Z]);)t+=e[Z++];return t}function zU(e){let t=``;for(;Z4)){if(n.length===4){if(n[3].type!==X.Alpha)return;n[3]=n[3].value}return n.length===3&&n.push({type:X.None,value:void 0}),n.every(e=>e.type!==X.Alpha)?n:void 0}}function WU(e,t){e._i=0;let n=e[e._i++];if(!n||n.type!==X.Function)return;let r=UU(e,t);if(r)return r.unshift(n.value),r}const GU=e=>{if(typeof e!=`string`)return;let t=VU(e),n=t?WU(t,!0):void 0,r,i=0,a=EU.length;for(;ie===`transparent`?{mode:`rgb`,r:0,g:0,b:0,alpha:0}:void 0;var XU=YU;const ZU=(e,t,n)=>e+n*(t-e),QU=e=>{let t=[];for(let n=0;nt=>{let n=QU(t);return t=>{let r=t*n.length,i=t>=1?n.length-1:Math.max(Math.floor(r),0),a=n[i];return a===void 0?void 0:e(a[0],a[1],r-i)}},Q=$U(ZU),eW=e=>{let t=!1,n=e.map(e=>e===void 0?1:(t=!0,e));return t?n:e},tW={mode:`rgb`,channels:[`r`,`g`,`b`,`alpha`],parse:[JU,aU,yU,nU,XU,`srgb`],serialize:`srgb`,interpolate:{r:Q,g:Q,b:Q,alpha:{use:Q,fixup:eW}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}};var nW=tW;const rW=(e=0)=>Math.abs(e)**(563/256)*Math.sign(e),iW=e=>{let t=rW(e.r),n=rW(e.g),r=rW(e.b),i={mode:`xyz65`,x:.5766690429101305*t+.1855582379065463*n+.1882286462349947*r,y:.297344975250536*t+.6273635662554661*n+.0752914584939979*r,z:.0270313613864123*t+.0706888525358272*n+.9913375368376386*r};return e.alpha!==void 0&&(i.alpha=e.alpha),i};var aW=iW;const oW=e=>Math.abs(e)**(256/563)*Math.sign(e),sW=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`a98`,r:oW(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*n),g:oW(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*n),b:oW(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*n)};return r!==void 0&&(i.alpha=r),i};var cW=sW;const lW=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*((t+.055)/1.055)**2.4},uW=({r:e,g:t,b:n,alpha:r})=>{let i={mode:`lrgb`,r:lW(e),g:lW(t),b:lW(n)};return r!==void 0&&(i.alpha=r),i};var dW=uW;const fW=e=>{let{r:t,g:n,b:r,alpha:i}=dW(e),a={mode:`xyz65`,x:.4123907992659593*t+.357584339383878*n+.1804807884018343*r,y:.2126390058715102*t+.715168678767756*n+.0721923153607337*r,z:.0193308187155918*t+.119194779794626*n+.9505321522496607*r};return i!==void 0&&(a.alpha=i),a};var pW=fW;const mW=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*t**(1/2.4)-.055):e*12.92},hW=({r:e,g:t,b:n,alpha:r},i=`rgb`)=>{let a={mode:i,r:mW(e),g:mW(t),b:mW(n)};return r!==void 0&&(a.alpha=r),a};var gW=hW;const _W=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=gW({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*n,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*n,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*n});return r!==void 0&&(i.alpha=r),i};var vW=_W;const yW={...nW,mode:`a98`,parse:[`a98-rgb`],serialize:`a98-rgb`,fromMode:{rgb:e=>cW(pW(e)),xyz65:cW},toMode:{rgb:e=>vW(aW(e)),xyz65:aW}};var bW=yW;const xW=e=>(e%=360)<0?e+360:e;var SW=xW;const CW=(e,t)=>e.map((n,r,i)=>{if(n===void 0)return n;let a=SW(n);return r===0||e[r-1]===void 0?a:t(a-SW(i[r-1]))}).reduce((e,t)=>!e.length||t===void 0||e[e.length-1]===void 0?(e.push(t),e):(e.push(t+e[e.length-1]),e),[]),wW=e=>CW(e,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),TW=[-.14861,1.78277,-.29227,-.90649,1.97294,0],EW=Math.PI/180,DW=180/Math.PI;let OW=TW[3]*TW[4],kW=TW[1]*TW[4],AW=TW[1]*TW[2]-TW[0]*TW[3];const jW=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(AW*n+e*OW-t*kW)/(AW+OW-kW),a=n-i,o=(TW[4]*(t-i)-TW[2]*a)/TW[3],s={mode:`cubehelix`,l:i,s:i===0||i===1?void 0:Math.sqrt(a*a+o*o)/(TW[4]*i*(1-i))};return s.s&&(s.h=Math.atan2(o,a)*DW-120),r!==void 0&&(s.alpha=r),s};var MW=jW;const NW=({h:e,s:t,l:n,alpha:r})=>{let i={mode:`rgb`};e=(e===void 0?0:e+120)*EW,n===void 0&&(n=0);let a=t===void 0?0:t*n*(1-n),o=Math.cos(e),s=Math.sin(e);return i.r=n+a*(TW[0]*o+TW[1]*s),i.g=n+a*(TW[2]*o+TW[3]*s),i.b=n+a*(TW[4]*o+TW[5]*s),r!==void 0&&(i.alpha=r),i};var PW=NW;const FW=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let n=SW(e.h),r=SW(t.h),i=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*i},IW=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let n=SW(e.h),r=SW(t.h);return Math.abs(r-n)>180?n-(r-360*Math.sign(r-n)):r-n},LW=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let n=SW(e.h),r=SW(t.h),i=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*i},RW=e=>{let t=e.reduce((e,t)=>{if(t!==void 0){let n=t*Math.PI/180;e.sin+=Math.sin(n),e.cos+=Math.cos(n)}return e},{sin:0,cos:0}),n=Math.atan2(t.sin,t.cos)*180/Math.PI;return n<0?360+n:n},zW={mode:`cubehelix`,channels:[`h`,`s`,`l`,`alpha`],parse:[`--cubehelix`],serialize:`--cubehelix`,ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:MW},toMode:{rgb:PW},interpolate:{h:{use:Q,fixup:wW},s:Q,l:Q,alpha:{use:Q,fixup:eW}},difference:{h:FW},average:{h:RW}};var BW=zW;const VW=({l:e,a:t,b:n,alpha:r},i=`lch`)=>{t===void 0&&(t=0),n===void 0&&(n=0);let a=Math.sqrt(t*t+n*n),o={mode:i,l:e,c:a};return a&&(o.h=SW(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(o.alpha=r),o};var HW=VW;const UW=({l:e,c:t,h:n,alpha:r},i=`lab`)=>{n===void 0&&(n=0);let a={mode:i,l:e,a:t?t*Math.cos(n/180*Math.PI):0,b:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(a.alpha=r),a};var WW=UW;const GW=29**3/3**3,KW=6**3/29**3,qW={X:.3457/.3585,Y:1,Z:.2958/.3585},JW={X:.3127/.329,Y:1,Z:.3583/.329},YW=29**3/3**3,XW=6**3/29**3;let ZW=e=>e**3>KW?e**3:(116*e-16)/GW;const QW=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+16)/116,a=t/500+i,o=i-n/200,s={mode:`xyz65`,x:ZW(a)*JW.X,y:ZW(i)*JW.Y,z:ZW(o)*JW.Z};return r!==void 0&&(s.alpha=r),s};var $W=QW;const eG=e=>vW($W(e));var tG=eG;const nG=e=>e>KW?Math.cbrt(e):(GW*e+16)/116,rG=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=nG(e/JW.X),a=nG(t/JW.Y),o=nG(n/JW.Z),s={mode:`lab65`,l:116*a-16,a:500*(i-a),b:200*(a-o)};return r!==void 0&&(s.alpha=r),s};var iG=rG;const aG=e=>{let t=iG(pW(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};var oG=aG;const sG=1,cG=1,lG=26/180*Math.PI,uG=Math.cos(lG),dG=Math.sin(lG),fG=100/Math.log(139/100),pG=({l:e,c:t,h:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`lab65`,l:(Math.exp(e*sG/fG)-1)/.0039},a=(Math.exp(.0435*t*cG*sG)-1)/.075,o=a*Math.cos(n/180*Math.PI-lG),s=a*Math.sin(n/180*Math.PI-lG);return i.a=o*uG-s/.83*dG,i.b=o*dG+s/.83*uG,r!==void 0&&(i.alpha=r),i};var mG=pG;const hG=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=t*uG+n*dG,a=.83*(n*uG-t*dG),o=Math.sqrt(i*i+a*a),s={mode:`dlch`,l:fG/sG*Math.log(1+.0039*e),c:Math.log(1+.075*o)/(.0435*cG*sG)};return s.c&&(s.h=SW((Math.atan2(a,i)+lG)/Math.PI*180)),r!==void 0&&(s.alpha=r),s};var gG=hG;const _G=e=>mG(HW(e,`dlch`)),vG=e=>WW(gG(e),`dlab`),yG={mode:`dlab`,parse:[`--din99o-lab`],serialize:`--din99o-lab`,toMode:{lab65:_G,rgb:e=>tG(_G(e))},fromMode:{lab65:vG,rgb:e=>vG(oG(e))},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:Q,a:Q,b:Q,alpha:{use:Q,fixup:eW}}};var bG=yG;const xG={mode:`dlch`,parse:[`--din99o-lch`],serialize:`--din99o-lch`,toMode:{lab65:mG,dlab:e=>WW(e,`dlab`),rgb:e=>tG(mG(e))},fromMode:{lab65:gG,dlab:e=>HW(e,`dlch`),rgb:e=>gG(oG(e))},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:Q,c:Q,h:{use:Q,fixup:wW},alpha:{use:Q,fixup:eW}},difference:{h:LW},average:{h:RW}};var SG=xG;function CG({h:e,s:t,i:n,alpha:r}){e=SW(e===void 0?0:e),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:n*(1+t*(3/(2-i)-1)),g:n*(1+t*(3*(1-i)/(2-i)-1)),b:n*(1-t)};break;case 1:a={r:n*(1+t*(3*(1-i)/(2-i)-1)),g:n*(1+t*(3/(2-i)-1)),b:n*(1-t)};break;case 2:a={r:n*(1-t),g:n*(1+t*(3/(2-i)-1)),b:n*(1+t*(3*(1-i)/(2-i)-1))};break;case 3:a={r:n*(1-t),g:n*(1+t*(3*(1-i)/(2-i)-1)),b:n*(1+t*(3/(2-i)-1))};break;case 4:a={r:n*(1+t*(3*(1-i)/(2-i)-1)),g:n*(1-t),b:n*(1+t*(3/(2-i)-1))};break;case 5:a={r:n*(1+t*(3/(2-i)-1)),g:n*(1-t),b:n*(1+t*(3*(1-i)/(2-i)-1))};break;default:a={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return a.mode=`rgb`,r!==void 0&&(a.alpha=r),a}function wG({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.max(e,t,n),a=Math.min(e,t,n),o={mode:`hsi`,s:e+t+n===0?0:1-3*a/(e+t+n),i:(e+t+n)/3};return i-a!==0&&(o.h=(i===e?(t-n)/(i-a)+(t{switch(t){case`deg`:return+e;case`rad`:return e/Math.PI*180;case`grad`:return e/10*9;case`turn`:return e*360}};var AG=kG;const jG=RegExp(`^hsla?\\(\\s*${fU}${mU}${cU}${mU}${cU}\\s*(?:,\\s*${uU}\\s*)?\\)$`),MG=e=>{let t=e.match(jG);if(!t)return;let n={mode:`hsl`};return t[3]===void 0?t[1]!==void 0&&t[2]!==void 0&&(n.h=AG(t[1],t[2])):n.h=+t[3],t[4]!==void 0&&(n.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(n.l=Math.min(Math.max(0,t[5]/100),1)),t[6]===void 0?t[7]!==void 0&&(n.alpha=Math.max(0,Math.min(1,+t[7]))):n.alpha=Math.max(0,Math.min(1,t[6]/100)),n};var NG=MG;function PG(e,t){if(!t||t[0]!==`hsl`&&t[0]!==`hsla`)return;let n={mode:`hsl`},[,r,i,a,o]=t;if(r.type!==X.None){if(r.type===X.Percentage)return;n.h=r.value}if(i.type!==X.None){if(i.type===X.Hue)return;n.s=i.value/100}if(a.type!==X.None){if(a.type===X.Hue)return;n.l=a.value/100}return o.type!==X.None&&(n.alpha=Math.min(1,Math.max(0,o.type===X.Number?o.value:o.value/100))),n}var FG=PG;const IG={mode:`hsl`,toMode:{rgb:DG},fromMode:{rgb:OG},channels:[`h`,`s`,`l`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[FG,NG],serialize:e=>`hsl(${e.h===void 0?`none`:e.h} ${e.s===void 0?`none`:e.s*100+`%`} ${e.l===void 0?`none`:e.l*100+`%`}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{h:{use:Q,fixup:wW},s:Q,l:Q,alpha:{use:Q,fixup:eW}},difference:{h:FW},average:{h:RW}};var LG=IG;function RG({h:e,s:t,v:n,alpha:r}){e=SW(e===void 0?0:e),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:n,g:n*(1-t*i),b:n*(1-t)};break;case 1:a={r:n*(1-t*i),g:n,b:n*(1-t)};break;case 2:a={r:n*(1-t),g:n,b:n*(1-t*i)};break;case 3:a={r:n*(1-t),g:n*(1-t*i),b:n};break;case 4:a={r:n*(1-t*i),g:n*(1-t),b:n};break;case 5:a={r:n,g:n*(1-t),b:n*(1-t*i)};break;default:a={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return a.mode=`rgb`,r!==void 0&&(a.alpha=r),a}function zG({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.max(e,t,n),a=Math.min(e,t,n),o={mode:`hsv`,s:i===0?0:1-a/i,v:i};return i-a!==0&&(o.h=(i===e?(t-n)/(i-a)+(t1){let e=t+n;t/=e,n/=e}return RG({h:e,s:n===1?1:1-t/(1-n),v:1-n,alpha:r})}function UG(e){let t=zG(e);if(t===void 0)return;let n=t.s===void 0?0:t.s,r=t.v===void 0?0:t.v,i={mode:`hwb`,w:(1-n)*r,b:1-r};return t.h!==void 0&&(i.h=t.h),t.alpha!==void 0&&(i.alpha=t.alpha),i}function WG(e,t){if(!t||t[0]!==`hwb`)return;let n={mode:`hwb`},[,r,i,a,o]=t;if(r.type!==X.None){if(r.type===X.Percentage)return;n.h=r.value}if(i.type!==X.None){if(i.type===X.Hue)return;n.w=i.value/100}if(a.type!==X.None){if(a.type===X.Hue)return;n.b=a.value/100}return o.type!==X.None&&(n.alpha=Math.min(1,Math.max(0,o.type===X.Number?o.value:o.value/100))),n}var GG=WG;const KG={mode:`hwb`,toMode:{rgb:HG},fromMode:{rgb:UG},channels:[`h`,`w`,`b`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[GG],serialize:e=>`hwb(${e.h===void 0?`none`:e.h} ${e.w===void 0?`none`:e.w*100+`%`} ${e.b===void 0?`none`:e.b*100+`%`}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{h:{use:Q,fixup:wW},w:Q,b:Q,alpha:{use:Q,fixup:eW}},difference:{h:IW},average:{h:RW}};var qG=KG;const JG=203,YG=.1593017578125,XG=78.84375,ZG=.8359375,QG=18.8515625,$G=18.6875;function eK(e){if(e<0)return 0;let t=e**(1/XG);return 1e4*(Math.max(0,t-ZG)/(QG-$G*t))**(1/YG)}function tK(e){if(e<0)return 0;let t=(e/1e4)**YG;return((ZG+QG*t)/(1+$G*t))**+XG}const nK=e=>Math.max(e/JG,0),rK=({i:e,t,p:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=eK(e+.008609037037932761*t+.11102962500302593*n),a=eK(e-.00860903703793275*t-.11102962500302599*n),o=eK(e+.5600313357106791*t-.32062717498731885*n),s={mode:`xyz65`,x:nK(2.070152218389422*i-1.3263473389671556*a+.2066510476294051*o),y:nK(.3647385209748074*i+.680566024947227*a-.0453045459220346*o),z:nK(-.049747207535812*i-.0492609666966138*a+1.1880659249923042*o)};return r!==void 0&&(s.alpha=r),s};var iK=rK;const aK=(e=0)=>Math.max(e*JG,0),oK=({x:e,y:t,z:n,alpha:r})=>{let i=aK(e),a=aK(t),o=aK(n),s=tK(.3592832590121217*i+.6976051147779502*a-.0358915932320289*o),c=tK(-.1920808463704995*i+1.1004767970374323*a+.0753748658519118*o),l=tK(.0070797844607477*i+.0748396662186366*a+.8433265453898765*o),u=.5*s+.5*c,d=1.61376953125*s-3.323486328125*c+1.709716796875*l,f=4.378173828125*s-4.24560546875*c-.132568359375*l,p={mode:`itp`,i:u,t:d,p:f};return r!==void 0&&(p.alpha=r),p};var sK=oK;const cK={mode:`itp`,channels:[`i`,`t`,`p`,`alpha`],parse:[`--ictcp`],serialize:`--ictcp`,toMode:{xyz65:iK,rgb:e=>vW(iK(e))},fromMode:{xyz65:sK,rgb:e=>sK(pW(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:Q,t:Q,p:Q,alpha:{use:Q,fixup:eW}}};var lK=cK;const uK=134.03437499999998,dK=16295499532821565e-27,fK=e=>{if(e<0)return 0;let t=(e/1e4)**YG;return((ZG+QG*t)/(1+$G*t))**+uK},pK=(e=0)=>Math.max(e*203,0),mK=({x:e,y:t,z:n,alpha:r})=>{e=pK(e),t=pK(t),n=pK(n);let i=1.15*e-.15*n,a=.66*t+.34*e,o=fK(.41478972*i+.579999*a+.014648*n),s=fK(-.20151*i+1.120649*a+.0531008*n),c=fK(-.0166008*i+.2648*a+.6684799*n),l=(o+s)/2,u={mode:`jab`,j:.44*l/(1-.56*l)-dK,a:3.524*o-4.066708*s+.542708*c,b:.199076*o+1.096799*s-1.295875*c};return r!==void 0&&(u.alpha=r),u};var hK=mK;const gK=134.03437499999998,_K=16295499532821565e-27,vK=e=>{if(e<0)return 0;let t=e**(1/gK);return 1e4*((ZG-t)/($G*t-QG))**(1/YG)},yK=e=>e/203,bK=({j:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+_K)/(.44+.56*(e+_K)),a=vK(i+.13860504*t+.058047316*n),o=vK(i-.13860504*t-.058047316*n),s=vK(i-.096019242*t-.8118919*n),c={mode:`xyz65`,x:yK(1.661373024652174*a-.914523081304348*o+.23136208173913045*s),y:yK(-.3250758611844533*a+1.571847026732543*o-.21825383453227928*s),z:yK(-.090982811*a-.31272829*o+1.5227666*s)};return r!==void 0&&(c.alpha=r),c};var xK=bK;const SK=e=>{let t=hK(pW(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};var CK=SK;const wK=e=>vW(xK(e));var TK=wK;const EK={mode:`jab`,channels:[`j`,`a`,`b`,`alpha`],parse:[`--jzazbz`],serialize:`--jzazbz`,fromMode:{rgb:CK,xyz65:hK},toMode:{rgb:TK,xyz65:xK},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:Q,a:Q,b:Q,alpha:{use:Q,fixup:eW}}};var DK=EK;const OK=({j:e,a:t,b:n,alpha:r})=>{t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.sqrt(t*t+n*n),a={mode:`jch`,j:e,c:i};return i&&(a.h=SW(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(a.alpha=r),a};var kK=OK;const AK=({j:e,c:t,h:n,alpha:r})=>{n===void 0&&(n=0);let i={mode:`jab`,j:e,a:t?t*Math.cos(n/180*Math.PI):0,b:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(i.alpha=r),i};var jK=AK;const MK={mode:`jch`,parse:[`--jzczhz`],serialize:`--jzczhz`,toMode:{jab:jK,rgb:e=>TK(jK(e))},fromMode:{rgb:e=>kK(CK(e)),jab:kK},channels:[`j`,`c`,`h`,`alpha`],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:Q,fixup:wW},c:Q,j:Q,alpha:{use:Q,fixup:eW}},difference:{h:LW},average:{h:RW}};var NK=MK;const PK=29**3/3**3,FK=6**3/29**3;let IK=e=>e**3>FK?e**3:(116*e-16)/PK;const LK=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+16)/116,a=t/500+i,o=i-n/200,s={mode:`xyz50`,x:IK(a)*qW.X,y:IK(i)*qW.Y,z:IK(o)*qW.Z};return r!==void 0&&(s.alpha=r),s};var RK=LK;const zK=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=gW({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*n,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*n,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*n});return r!==void 0&&(i.alpha=r),i};var BK=zK;const VK=e=>BK(RK(e));var HK=VK;const UK=e=>{let{r:t,g:n,b:r,alpha:i}=dW(e),a={mode:`xyz50`,x:.436065742824811*t+.3851514688337912*n+.14307845442264197*r,y:.22249319175623702*t+.7168870538238823*n+.06061979053616537*r,z:.013923904500943465*t+.09708128566574634*n+.7140993584005155*r};return i!==void 0&&(a.alpha=i),a};var WK=UK;const GK=e=>e>FK?Math.cbrt(e):(PK*e+16)/116,KK=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=GK(e/qW.X),a=GK(t/qW.Y),o=GK(n/qW.Z),s={mode:`lab`,l:116*a-16,a:500*(i-a),b:200*(a-o)};return r!==void 0&&(s.alpha=r),s};var qK=KK;const JK=e=>{let t=qK(WK(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};var YK=JK;function XK(e,t){if(!t||t[0]!==`lab`)return;let n={mode:`lab`},[,r,i,a,o]=t;if(!(r.type===X.Hue||i.type===X.Hue||a.type===X.Hue))return r.type!==X.None&&(n.l=Math.min(Math.max(0,r.value),100)),i.type!==X.None&&(n.a=i.type===X.Number?i.value:i.value*125/100),a.type!==X.None&&(n.b=a.type===X.Number?a.value:a.value*125/100),o.type!==X.None&&(n.alpha=Math.min(1,Math.max(0,o.type===X.Number?o.value:o.value/100))),n}var ZK=XK;const QK={mode:`lab`,toMode:{xyz50:RK,rgb:HK},fromMode:{xyz50:qK,rgb:YK},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[ZK],serialize:e=>`lab(${e.l===void 0?`none`:e.l} ${e.a===void 0?`none`:e.a} ${e.b===void 0?`none`:e.b}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{l:Q,a:Q,b:Q,alpha:{use:Q,fixup:eW}}};var $K=QK;const eq={...$K,mode:`lab65`,parse:[`--lab-d65`],serialize:`--lab-d65`,toMode:{xyz65:$W,rgb:tG},fromMode:{xyz65:iG,rgb:oG},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};var tq=eq;function nq(e,t){if(!t||t[0]!==`lch`)return;let n={mode:`lch`},[,r,i,a,o]=t;if(r.type!==X.None){if(r.type===X.Hue)return;n.l=Math.min(Math.max(0,r.value),100)}if(i.type!==X.None&&(n.c=Math.max(0,i.type===X.Number?i.value:i.value*150/100)),a.type!==X.None){if(a.type===X.Percentage)return;n.h=a.value}return o.type!==X.None&&(n.alpha=Math.min(1,Math.max(0,o.type===X.Number?o.value:o.value/100))),n}var rq=nq;const iq={mode:`lch`,toMode:{lab:WW,rgb:e=>HK(WW(e))},fromMode:{rgb:e=>HW(YK(e)),lab:HW},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[rq],serialize:e=>`lch(${e.l===void 0?`none`:e.l} ${e.c===void 0?`none`:e.c} ${e.h===void 0?`none`:e.h}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{h:{use:Q,fixup:wW},c:Q,l:Q,alpha:{use:Q,fixup:eW}},difference:{h:LW},average:{h:RW}};var aq=iq;const oq={...aq,mode:`lch65`,parse:[`--lch-d65`],serialize:`--lch-d65`,toMode:{lab65:e=>WW(e,`lab65`),rgb:e=>tG(WW(e,`lab65`))},fromMode:{rgb:e=>HW(oG(e),`lch65`),lab65:e=>HW(e,`lch65`)},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}};var sq=oq;const cq=({l:e,u:t,v:n,alpha:r})=>{t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.sqrt(t*t+n*n),a={mode:`lchuv`,l:e,c:i};return i&&(a.h=SW(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(a.alpha=r),a};var lq=cq;const uq=({l:e,c:t,h:n,alpha:r})=>{n===void 0&&(n=0);let i={mode:`luv`,l:e,u:t?t*Math.cos(n/180*Math.PI):0,v:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(i.alpha=r),i};var dq=uq;const fq=(e,t,n)=>4*e/(e+15*t+3*n),pq=(e,t,n)=>9*t/(e+15*t+3*n),mq=fq(qW.X,qW.Y,qW.Z),hq=pq(qW.X,qW.Y,qW.Z),gq=e=>e<=FK?PK*e:116*Math.cbrt(e)-16,_q=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=gq(t/qW.Y),a=fq(e,t,n),o=pq(e,t,n);!isFinite(a)||!isFinite(o)?i=a=o=0:(a=13*i*(a-mq),o=13*i*(o-hq));let s={mode:`luv`,l:i,u:a,v:o};return r!==void 0&&(s.alpha=r),s};var vq=_q;const yq=(e,t,n)=>4*e/(e+15*t+3*n),bq=(e,t,n)=>9*t/(e+15*t+3*n),xq=yq(qW.X,qW.Y,qW.Z),Sq=bq(qW.X,qW.Y,qW.Z),Cq=({l:e,u:t,v:n,alpha:r})=>{if(e===void 0&&(e=0),e===0)return{mode:`xyz50`,x:0,y:0,z:0};t===void 0&&(t=0),n===void 0&&(n=0);let i=t/(13*e)+xq,a=n/(13*e)+Sq,o=qW.Y*(e<=8?e/PK:((e+16)/116)**3),s=o*(9*i)/(4*a),c=o*(12-3*i-20*a)/(4*a),l={mode:`xyz50`,x:s,y:o,z:c};return r!==void 0&&(l.alpha=r),l};var wq=Cq;const Tq=e=>lq(vq(WK(e))),Eq=e=>BK(wq(dq(e))),Dq={mode:`lchuv`,toMode:{luv:dq,rgb:Eq},fromMode:{rgb:Tq,luv:lq},channels:[`l`,`c`,`h`,`alpha`],parse:[`--lchuv`],serialize:`--lchuv`,ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:Q,fixup:wW},c:Q,l:Q,alpha:{use:Q,fixup:eW}},difference:{h:LW},average:{h:RW}};var Oq=Dq;const kq={...nW,mode:`lrgb`,toMode:{rgb:gW},fromMode:{rgb:dW},parse:[`srgb-linear`],serialize:`srgb-linear`};var Aq=kq;const jq={mode:`luv`,toMode:{xyz50:wq,rgb:e=>BK(wq(e))},fromMode:{xyz50:vq,rgb:e=>vq(WK(e))},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:Q,u:Q,v:Q,alpha:{use:Q,fixup:eW}}};var Mq=jq;const Nq=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.cbrt(.41222147079999993*e+.5363325363*t+.0514459929*n),a=Math.cbrt(.2119034981999999*e+.6806995450999999*t+.1073969566*n),o=Math.cbrt(.08830246189999998*e+.2817188376*t+.6299787005000002*n),s={mode:`oklab`,l:.2104542553*i+.793617785*a-.0040720468*o,a:1.9779984951*i-2.428592205*a+.4505937099*o,b:.0259040371*i+.7827717662*a-.808675766*o};return r!==void 0&&(s.alpha=r),s};var Pq=Nq;const Fq=e=>{let t=Pq(dW(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};var Iq=Fq;const Lq=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e*.9999999984505198+.39633779217376786*t+.2158037580607588*n)**3,a=(e*1.0000000088817609-.10556134232365635*t-.06385417477170591*n)**3,o=(e*1.0000000546724108-.08948418209496575*t-1.2914855378640917*n)**3,s={mode:`lrgb`,r:4.076741661347994*i-3.307711590408193*a+.230969928729428*o,g:-1.2684380040921763*i+2.6097574006633715*a-.3413193963102197*o,b:-.004196086541837188*i-.7034186144594493*a+1.7076147009309444*o};return r!==void 0&&(s.alpha=r),s};var Rq=Lq;const zq=e=>gW(Rq(e));var Bq=zq;function Vq(e){let t=.206,n=.03,r=(1+t)/(1+n);return .5*(r*e-t+Math.sqrt((r*e-t)*(r*e-t)+4*n*r*e))}function Hq(e){let t=.206,n=.03,r=(1+t)/(1+n);return(e*e+t*e)/(r*(e+n))}function Uq(e,t){let n,r,i,a,o,s,c,l;-1.88170328*e-.80936493*t>1?(n=1.19086277,r=1.76576728,i=.59662641,a=.75515197,o=.56771245,s=4.0767416621,c=-3.3077115913,l=.2309699292):1.81444104*e-1.19445276*t>1?(n=.73956515,r=-.45954404,i=.08285427,a=.1254107,o=.14503204,s=-1.2684380046,c=2.6097574011,l=-.3413193965):(n=1.35733652,r=-.00915799,i=-1.1513021,a=-.50559606,o=.00692167,s=-.0041960863,c=-.7034186147,l=1.707614701);let u=n+r*e+i*t+a*e*e+o*e*t,d=.3963377774*e+.2158037573*t,f=-.1055613458*e-.0638541728*t,p=-.0894841775*e-1.291485548*t;{let e=1+u*d,t=1+u*f,n=1+u*p,r=e*e*e,i=t*t*t,a=n*n*n,o=3*d*e*e,m=3*f*t*t,h=3*p*n*n,g=6*d*d*e,_=6*f*f*t,v=6*p*p*n,y=s*r+c*i+l*a,b=s*o+c*m+l*h,x=s*g+c*_+l*v;u-=y*b/(b*b-.5*y*x)}return u}function Wq(e,t){let n=Uq(e,t),r=Rq({l:1,a:n*e,b:n*t}),i=Math.cbrt(1/Math.max(r.r,r.g,r.b)),a=i*n;return[i,a]}function Gq(e,t,n,r,i,a=null){a||=Wq(e,t);let o;if((n-i)*a[1]-(a[0]-i)*r<=0)o=a[1]*i/(r*a[0]+a[1]*(i-n));else{o=a[1]*(i-1)/(r*(a[0]-1)+a[1]*(i-n));{let a=n-i,s=r,c=.3963377774*e+.2158037573*t,l=-.1055613458*e-.0638541728*t,u=-.0894841775*e-1.291485548*t,d=a+s*c,f=a+s*l,p=a+s*u;{let e=i*(1-o)+o*n,t=o*r,a=e+t*c,s=e+t*l,m=e+t*u,h=a*a*a,g=s*s*s,_=m*m*m,v=3*d*a*a,y=3*f*s*s,b=3*p*m*m,x=6*d*d*a,S=6*f*f*s,C=6*p*p*m,w=4.0767416621*h-3.3077115913*g+.2309699292*_-1,T=4.0767416621*v-3.3077115913*y+.2309699292*b,E=4.0767416621*x-3.3077115913*S+.2309699292*C,D=T/(T*T-.5*w*E),O=-w*D,k=-1.2684380046*h+2.6097574011*g-.3413193965*_-1,A=-1.2684380046*v+2.6097574011*y-.3413193965*b,j=-1.2684380046*x+2.6097574011*S-.3413193965*C,M=A/(A*A-.5*k*j),N=-k*M,ee=-.0041960863*h-.7034186147*g+1.707614701*_-1,te=-.0041960863*v-.7034186147*y+1.707614701*b,P=-.0041960863*x-.7034186147*S+1.707614701*C,ne=te/(te*te-.5*ee*P),re=-ee*ne;O=D>=0?O:1e6,N=M>=0?N:1e6,re=ne>=0?re:1e6,o+=Math.min(O,Math.min(N,re))}}}return o}function Kq(e,t,n=null){n||=Wq(e,t);let r=n[0],i=n[1];return[i/r,i/(1-r)]}function qq(e,t,n){let r=Wq(t,n),i=Gq(t,n,e,1,e,r),a=Kq(t,n,r),o=.11516993+1/(7.4477897+4.1590124*n+t*(-2.19557347+1.75198401*n+t*(-2.13704948-10.02301043*n+t*(-4.24894561+5.38770819*n+4.69891013*t)))),s=.11239642+1/(1.6132032-.68124379*n+t*(.40370612+.90148123*n+t*(-.27087943+.6122399*n+t*(.00299215-.45399568*n-.14661872*t)))),c=i/Math.min(e*a[0],(1-e)*a[1]),l=e*o,u=(1-e)*s,d=.9*c*Math.sqrt(Math.sqrt(1/(1/(l*l*l*l)+1/(u*u*u*u))));l=e*.4,u=(1-e)*.8;let f=Math.sqrt(1/(1/(l*l)+1/(u*u)));return[f,d,i]}function Jq(e){let t=e.l===void 0?0:e.l,n=e.a===void 0?0:e.a,r=e.b===void 0?0:e.b,i={mode:`okhsl`,l:Vq(t)};e.alpha!==void 0&&(i.alpha=e.alpha);let a=Math.sqrt(n*n+r*r);if(!a)return i.s=0,i;let[o,s,c]=qq(t,n/a,r/a),l;if(aJq(Iq(e))},toMode:{oklab:Yq,rgb:e=>Bq(Yq(e))}};var Zq=Xq;function Qq(e){let t=e.l===void 0?0:e.l,n=e.a===void 0?0:e.a,r=e.b===void 0?0:e.b,i=Math.sqrt(n*n+r*r),a=i?n/i:1,o=i?r/i:1,[s,c]=Kq(a,o),l=.5,u=1-l/s,d=c/(i+t*c),f=d*t,p=d*i,m=Hq(f),h=p*m/f,g=Rq({l:m,a:a*h,b:o*h}),_=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));t/=_,i=i/_*Vq(t)/t,t=Vq(t);let v={mode:`okhsv`,s:i?(l+c)*p/(c*l+c*u*p):0,v:t?t/f:0};return v.s&&(v.h=SW(Math.atan2(r,n)*180/Math.PI)),e.alpha!==void 0&&(v.alpha=e.alpha),v}function $q(e){let t={mode:`oklab`};e.alpha!==void 0&&(t.alpha=e.alpha);let n=e.h===void 0?0:e.h,r=e.s===void 0?0:e.s,i=e.v===void 0?0:e.v,a=Math.cos(n/180*Math.PI),o=Math.sin(n/180*Math.PI),[s,c]=Kq(a,o),l=.5,u=1-l/s,d=1-r*l/(l+c-c*u*r),f=r*c*l/(l+c-c*u*r),p=Hq(d),m=f*p/d,h=Rq({l:p,a:a*m,b:o*m}),g=Math.cbrt(1/Math.max(h.r,h.g,h.b,0)),_=Hq(i*d),v=f*_/d;return t.l=_*g,t.a=v*a*g,t.b=v*o*g,t}const eJ={...VG,mode:`okhsv`,channels:[`h`,`s`,`v`,`alpha`],parse:[`--okhsv`],serialize:`--okhsv`,fromMode:{oklab:Qq,rgb:e=>Qq(Iq(e))},toMode:{oklab:$q,rgb:e=>Bq($q(e))}};var tJ=eJ;function nJ(e,t){if(!t||t[0]!==`oklab`)return;let n={mode:`oklab`},[,r,i,a,o]=t;if(!(r.type===X.Hue||i.type===X.Hue||a.type===X.Hue))return r.type!==X.None&&(n.l=Math.min(Math.max(0,r.type===X.Number?r.value:r.value/100),1)),i.type!==X.None&&(n.a=i.type===X.Number?i.value:i.value*.4/100),a.type!==X.None&&(n.b=a.type===X.Number?a.value:a.value*.4/100),o.type!==X.None&&(n.alpha=Math.min(1,Math.max(0,o.type===X.Number?o.value:o.value/100))),n}var rJ=nJ;const iJ={...$K,mode:`oklab`,toMode:{lrgb:Rq,rgb:Bq},fromMode:{lrgb:Pq,rgb:Iq},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[rJ],serialize:e=>`oklab(${e.l===void 0?`none`:e.l} ${e.a===void 0?`none`:e.a} ${e.b===void 0?`none`:e.b}${e.alpha<1?` / ${e.alpha}`:``})`};var aJ=iJ;function oJ(e,t){if(!t||t[0]!==`oklch`)return;let n={mode:`oklch`},[,r,i,a,o]=t;if(r.type!==X.None){if(r.type===X.Hue)return;n.l=Math.min(Math.max(0,r.type===X.Number?r.value:r.value/100),1)}if(i.type!==X.None&&(n.c=Math.max(0,i.type===X.Number?i.value:i.value*.4/100)),a.type!==X.None){if(a.type===X.Percentage)return;n.h=a.value}return o.type!==X.None&&(n.alpha=Math.min(1,Math.max(0,o.type===X.Number?o.value:o.value/100))),n}var sJ=oJ;const cJ={...aq,mode:`oklch`,toMode:{oklab:e=>WW(e,`oklab`),rgb:e=>Bq(WW(e,`oklab`))},fromMode:{rgb:e=>HW(Iq(e),`oklch`),oklab:e=>HW(e,`oklch`)},parse:[sJ],serialize:e=>`oklch(${e.l===void 0?`none`:e.l} ${e.c===void 0?`none`:e.c} ${e.h===void 0?`none`:e.h}${e.alpha<1?` / ${e.alpha}`:``})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}};var lJ=cJ;const uJ=e=>{let{r:t,g:n,b:r,alpha:i}=dW(e),a={mode:`xyz65`,x:.486570948648216*t+.265667693169093*n+.1982172852343625*r,y:.2289745640697487*t+.6917385218365062*n+.079286914093745*r,z:0*t+.0451133818589026*n+1.043944368900976*r};return i!==void 0&&(a.alpha=i),a};var dJ=uJ;const fJ=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=gW({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*n,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*n,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*n},`p3`);return r!==void 0&&(i.alpha=r),i};var pJ=fJ;const mJ={...nW,mode:`p3`,parse:[`display-p3`],serialize:`display-p3`,fromMode:{rgb:e=>pJ(pW(e)),xyz65:pJ},toMode:{rgb:e=>vW(dJ(e)),xyz65:dJ}};var hJ=mJ;const gJ=e=>{let t=Math.abs(e);return t>=1/512?Math.sign(e)*t**(1/1.8):16*e},_J=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`prophoto`,r:gJ(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*n),g:gJ(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*n),b:gJ(e*0+t*0+1.2119675456389452*n)};return r!==void 0&&(i.alpha=r),i};var vJ=_J;const yJ=(e=0)=>{let t=Math.abs(e);return t>=16/512?Math.sign(e)*t**1.8:e/16},bJ=e=>{let t=yJ(e.r),n=yJ(e.g),r=yJ(e.b),i={mode:`xyz50`,x:.7977666449006423*t+.1351812974005331*n+.0313477341283922*r,y:.2880748288194013*t+.7118352342418731*n+899369387256e-16*r,z:0*t+0*n+.8251046025104602*r};return e.alpha!==void 0&&(i.alpha=e.alpha),i};var xJ=bJ;const SJ={...nW,mode:`prophoto`,parse:[`prophoto-rgb`],serialize:`prophoto-rgb`,fromMode:{xyz50:vJ,rgb:e=>vJ(WK(e))},toMode:{xyz50:xJ,rgb:e=>BK(xJ(e))}};var CJ=SJ;const wJ=1.09929682680944,TJ=.018053968510807,EJ=e=>{let t=Math.abs(e);return t>TJ?(Math.sign(e)||1)*(wJ*t**.45-(wJ-1)):4.5*e},DJ=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`rec2020`,r:EJ(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*n),g:EJ(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*n),b:EJ(e*.0176398574453108-t*.0427706132578085+.9421031212354739*n)};return r!==void 0&&(i.alpha=r),i};var OJ=DJ;const kJ=1.09929682680944,AJ=.018053968510807,jJ=(e=0)=>{let t=Math.abs(e);return t{let t=jJ(e.r),n=jJ(e.g),r=jJ(e.b),i={mode:`xyz65`,x:.6369580483012911*t+.1446169035862083*n+.1688809751641721*r,y:.262700212011267*t+.6779980715188708*n+.059301716469862*r,z:0*t+.0280726930490874*n+1.0609850577107909*r};return e.alpha!==void 0&&(i.alpha=e.alpha),i};var NJ=MJ;const PJ={...nW,mode:`rec2020`,fromMode:{xyz65:OJ,rgb:e=>OJ(pW(e))},toMode:{xyz65:NJ,rgb:e=>vW(NJ(e))},parse:[`rec2020`],serialize:`rec2020`};var FJ=PJ;const IJ=.0037930732552754493,LJ=Math.cbrt(IJ),RJ=e=>Math.cbrt(e)-LJ,zJ=e=>{let{r:t,g:n,b:r,alpha:i}=dW(e),a=RJ(.3*t+.622*n+.078*r+IJ),o=RJ(.23*t+.692*n+.078*r+IJ),s=RJ(.2434226892454782*t+.2047674442449682*n+.5518098665095535*r+IJ),c={mode:`xyb`,x:(a-o)/2,y:(a+o)/2,b:s-(a+o)/2};return i!==void 0&&(c.alpha=i),c};var BJ=zJ;const VJ=e=>(e+LJ)**3,HJ=({x:e,y:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=VJ(e+t)-IJ,a=VJ(t-e)-IJ,o=VJ(n+t)-IJ,s=gW({r:11.031566904639861*i-9.866943908131562*a-.16462299650829934*o,g:-3.2541473810744237*i+4.418770377582723*a-.16462299650829934*o,b:-3.6588512867136815*i+2.7129230459360922*a+1.9459282407775895*o});return r!==void 0&&(s.alpha=r),s};var UJ=HJ;const WJ={mode:`xyb`,channels:[`x`,`y`,`b`,`alpha`],parse:[`--xyb`],serialize:`--xyb`,toMode:{rgb:UJ},fromMode:{rgb:BJ},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:Q,y:Q,b:Q,alpha:{use:Q,fixup:eW}}};var GJ=WJ;const KJ={mode:`xyz50`,parse:[`xyz-d50`],serialize:`xyz-d50`,toMode:{rgb:BK,lab:qK},fromMode:{rgb:WK,lab:RK},channels:[`x`,`y`,`z`,`alpha`],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:Q,y:Q,z:Q,alpha:{use:Q,fixup:eW}}};var qJ=KJ;const JJ=e=>{let{x:t,y:n,z:r,alpha:i}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let a={mode:`xyz50`,x:1.0479298208405488*t+.0229467933410191*n-.0501922295431356*r,y:.0296278156881593*t+.990434484573249*n-.0170738250293851*r,z:-.0092430581525912*t+.0150551448965779*n+.7518742899580008*r};return i!==void 0&&(a.alpha=i),a};var YJ=JJ;const XJ=e=>{let{x:t,y:n,z:r,alpha:i}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let a={mode:`xyz65`,x:.9554734527042182*t-.0230985368742614*n+.0632593086610217*r,y:-.0283697069632081*t+1.0099954580058226*n+.021041398966943*r,z:.0123140016883199*t-.0205076964334779*n+1.3303659366080753*r};return i!==void 0&&(a.alpha=i),a};var ZJ=XJ;const QJ={mode:`xyz65`,toMode:{rgb:vW,xyz50:YJ},fromMode:{rgb:pW,xyz50:ZJ},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:Q,y:Q,z:Q,alpha:{use:Q,fixup:eW}}};var $J=QJ;const eY=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`yiq`,y:.29889531*e+.58662247*t+.11448223*n,i:.59597799*e-.2741761*t-.32180189*n,q:.21147017*e-.52261711*t+.31114694*n};return r!==void 0&&(i.alpha=r),i};var tY=eY;const nY=({y:e,i:t,q:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`rgb`,r:e+.95608445*t+.6208885*n,g:e-.27137664*t-.6486059*n,b:e-1.10561724*t+1.70250126*n};return r!==void 0&&(i.alpha=r),i};var rY=nY;const iY={mode:`yiq`,toMode:{rgb:rY},fromMode:{rgb:tY},channels:[`y`,`i`,`q`,`alpha`],parse:[`--yiq`],serialize:`--yiq`,ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:Q,i:Q,q:Q,alpha:{use:Q,fixup:eW}}};var aY=iY;const oY=(e,t)=>Math.round(e*(t=10**t))/t,sY=(e=4)=>t=>typeof t==`number`?oY(t,e):t;var cY=sY;let lY=cY(2);const uY=e=>Math.max(0,Math.min(1,e||0)),dY=e=>Math.round(uY(e)*255),fY=CU(`rgb`),pY=CU(`hsl`),mY=e=>{if(e===void 0)return;let t=dY(e.r),n=dY(e.g),r=dY(e.b);return`#`+(1<<24|t<<16|n<<8|r).toString(16).slice(1)},hY=e=>mY(fY(e)),gY=kU(bW),_Y=kU(BW),vY=kU(bG),yY=kU(SG),bY=kU(EG),xY=kU(LG),SY=kU(VG),CY=kU(qG),wY=kU(lK),TY=kU(DK),EY=kU(NK),DY=kU($K),OY=kU(tq),kY=kU(aq),AY=kU(sq),jY=kU(Oq),MY=kU(Aq),NY=kU(Mq),PY=kU(Zq),FY=kU(tJ),IY=kU(aJ),LY=kU(lJ),RY=kU(hJ),zY=kU(CJ),BY=kU(FJ),VY=kU(nW),HY=kU(GJ),UY=kU(qJ),WY=kU($J),GY=kU(aY),KY=220.44,qY=CU(`oklch`),JY=e=>{var t;return e?(t=qY(e))?.h:KY},YY=BB(`settings`,()=>{let e=R(),t=rF(`settings/language`,`en-US`),n=rF(`settings/stage/view/model-renderer`,`2d`),r=rF(`settings/audio/input`,`false`),i=H(()=>{var t;return(t=e.value)?.deviceId}),{audioInputs:a,ensurePermissions:o}=JP({constraints:{audio:!0}}),s=R(),c=R(`/assets/live2d/models/hiyori_pro_zh.zip`),l=R(`url`),u=R(!1),d=rF(`settings/live2d/position`,{x:0,y:0}),f=R({group:`Idle`,index:0}),p=R([]),m=rF(`settings/live2d/motion-map`,{}),h=rF(`settings/disable-transitions`,!0),g=rF(`settings/use-page-specific-transitions`,!0),_=rF(`settings/theme/colors/hue`,KY),v=rF(`settings/theme/colors/hue-dynamic`,!1),y=rF(`settings/allow-visible-on-all-workspaces`,!0);function b(e=KY){_.value=e,v.value=!1}function x(e){b(JY(e))}function S(e){if(v.value)return!1;let t=JY(e);if(!t)return!1;let n=Math.abs(t-_.value);return n<.01||n>359.99}return V(r,t=>{t===`false`&&(e.value=void 0),t===`true`&&o().then(()=>{e.value=a.value[0]})}),V(a,()=>{r.value===`true`&&!e.value&&(e.value=a.value[0])},{immediate:!0}),{live2dModelFile:s,live2dModelUrl:c,live2dLoadSource:l,live2dCurrentMotion:f,live2dPosition:d,availableLive2dMotions:p,live2dMotionMap:m,loadingLive2dModel:u,disableTransitions:h,usePageSpecificTransitions:g,language:t,stageView:n,themeColorsHue:_,themeColorsHueDynamic:v,isAudioInputOn:r,selectedAudioDevice:e,selectedAudioDeviceId:i,allowVisibleOnAllWorkspaces:y,setThemeColorsHue:b,applyPrimaryColorFrom:x,isColorSelectedForPrimary:S}});var XY=Rr({__name:`ArrowTransition`,props:{stageTransition:{default:()=>({primaryColor:`#666`,secondaryColor:`#ccc`})}},setup(e){let t=e,n=H(()=>t.stageTransition),r=H(()=>n.value.primaryColor||`#666`),i=H(()=>n.value.secondaryColor||`#ccc`);return $r(()=>{document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-2`,i.value)}),(e,t)=>(to(),oo(`div`,{class:`stage-transition-3`,style:L({zIndex:n.value.zIndex||100})},null,4))}}),ZY=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},QY=ZY(XY,[[`__scopeId`,`data-v-df576df0`]]),$Y=Rr({__name:`BubbleWaveOutTransition`,props:{stageTransition:null},setup(e){let t=e,n=H(()=>{var e;return(e=t.stageTransition)?.colors||[`#eee`,`#ebcb8b`,`#c56370`,`#3f3b52`]});return $r(()=>{var e,r;document.documentElement.style.setProperty(`--circle-expansion-delay`,`${(e=t.stageTransition)?.delay||0}s`),document.documentElement.style.setProperty(`--circle-expansion-duration`,`${(r=t.stageTransition)?.duration||.4}s`),n.value.forEach((e,t)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${t+1}`,e)})}),(t,r)=>{var i;return to(),oo(`div`,{class:`circle-expansion-transition`,style:L({zIndex:(i=e.stageTransition)?.zIndex||100})},[(to(!0),oo(Ya,null,gi(n.value,(e,t)=>(to(),oo(`div`,{key:t}))),128))],4)}}}),eX=ZY($Y,[[`__scopeId`,`data-v-0c29056c`]]),tX=Rr({__name:`FantasyFallTransition`,props:{stageTransition:null},setup(e){let t=e,n=H(()=>{var e;return(e=t.stageTransition)?.direction||`up`}),r=H(()=>`fantasy-fall-${n.value}`);return $r(()=>{var e,n,r,i,a,o;document.documentElement.style.setProperty(`--fantasy-fall-color`,(e=t.stageTransition)?.primaryColor||`#eee`),document.documentElement.style.setProperty(`--fantasy-fall-duration`,`${(n=t.stageTransition)?.duration||.6}s`),document.documentElement.style.setProperty(`--fantasy-fall-delay`,`${(r=t.stageTransition)?.delay||0}s`),document.documentElement.style.setProperty(`--fantasy-fall-radius-sm`,`${((i=t.stageTransition)==null||(i=i.borderRadius)==null?void 0:i.sm)||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-md`,`${((a=t.stageTransition)==null||(a=a.borderRadius)==null?void 0:a.md)||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-lg`,`${((o=t.stageTransition)==null||(o=o.borderRadius)==null?void 0:o.lg)||`50%`}`)}),(t,n)=>{var i;return to(),oo(`div`,{class:Se([`fantasy-fall-transition`,r.value]),style:L({zIndex:(i=e.stageTransition)?.zIndex??100})},null,6)}}}),nX=ZY(tX,[[`__scopeId`,`data-v-e62bf496`]]),rX=Rr({__name:`MultipleBlocksRevealTransition`,props:{stageTransition:null},setup(e){let t=e,n=H(()=>t.stageTransition),r=H(()=>{var e;return(e=n.value)?.primaryColor||`#666`}),i=H(()=>{var e;return(e=n.value)?.secondaryColor||`#ccc`});return $r(()=>{document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-2`,i.value)}),(e,t)=>{var r;return to(),oo(`div`,{class:`stage-transition-4`,style:L({zIndex:(r=n.value)?.zIndex??100})},t[0]||=[yo(`
`,5)],4)}}}),iX=ZY(rX,[[`__scopeId`,`data-v-6d1179fc`]]),aX=Rr({__name:`SlideTransition`,props:{stageTransition:null},setup(e){let t=e,n=H(()=>t.stageTransition),r=H(()=>{var e;return(e=n.value)?.primaryColor||`#666`}),i=H(()=>{var e;return(e=n.value)?.secondaryColor||`#ccc`});return V([n,r,i],()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,i.value)}),$r(()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,i.value)}),(e,t)=>{var r;return to(),oo(`div`,{class:`stage-transition-1`,style:L({zIndex:(r=n.value)?.zIndex??100})},null,4)}}}),oX=ZY(aX,[[`__scopeId`,`data-v-bf1d1566`]]),sX=Rr({__name:`SlopeSlideTransition`,props:{stageTransition:null},setup(e){let t=e,n=H(()=>t.stageTransition),r=H(()=>{var e;return(e=n.value)?.primaryColor??`#666`}),i=H(()=>{var e;return(e=n.value)?.secondaryColor??`#ccc`});return $r(()=>{document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-2`,i.value)}),(e,t)=>{var r;return to(),oo(`div`,{class:`stage-transition-2`,style:L({zIndex:(r=n.value)?.zIndex??100})},null,4)}}}),cX=ZY(sX,[[`__scopeId`,`data-v-8ff7120f`]]),lX=Rr({__name:`RectanglesRotateTransition`,props:{stageTransition:null},setup(e){let t=e;return $r(()=>{var e,n,r,i,a,o,s;document.documentElement.style.setProperty(`--rectangle-rotate-1-color`,(e=t.stageTransition)?.primaryColor||`#ebcb8b`),document.documentElement.style.setProperty(`--rectangle-rotate-2-color`,(n=t.stageTransition)?.secondaryColor||`#c56370`),document.documentElement.style.setProperty(`--rectangle-rotate-3-color`,(r=t.stageTransition)?.tertiaryColor||`#43445b`),document.documentElement.style.setProperty(`--rectangle-rotate-duration`,`${(i=t.stageTransition)?.duration||.6}s`),document.documentElement.style.setProperty(`--rectangle-rotate-delay`,`${(a=t.stageTransition)?.delay||0}s`),document.documentElement.style.setProperty(`--rectangle-rotate-stagger`,`${(o=t.stageTransition)?.staggerDelay||.1}s`),document.documentElement.style.setProperty(`--rectangle-rotate-rotation`,`${(s=t.stageTransition)?.rotation||270}deg`)}),(t,n)=>{var r;return to(),oo(`div`,{class:`rectangle-rotate-transition`,style:L({zIndex:(r=e.stageTransition)?.zIndex??100})},n[0]||=[po(`div`,{class:`rectangle rectangle-rotate-1`},[po(`div`)],-1),po(`div`,{class:`rectangle rectangle-rotate-2`},[po(`div`)],-1),po(`div`,{class:`rectangle rectangle-rotate-3`},[po(`div`)],-1)],4)}}}),uX=ZY(lX,[[`__scopeId`,`data-v-f4b1dc64`]]),dX=Rr({__name:`StageTransitionGroup`,props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(e){let t=e,n=JH(),r=R(!1),i=R(),a=R(``),o=R(),s=z({slide:{component:oX,duration:2700},"slope-slide":{component:cX,duration:2700},arrow:{component:QY,duration:2700},"multiple-blocks-reveal":{component:iX,duration:2800},"fantasy-fall":{component:nX,duration:2700},"rectangles-rotate":{component:uX,duration:2700},"bubble-wave-out":{component:eX,duration:1e3}}),c=R([]);function l(e){return c.value.push(e),()=>{let t=c.value.indexOf(e);t>=0&&c.value.splice(t,1)}}async function u(e,t={}){i.value=e;for(let n of c.value)try{await Promise.resolve(n(e,t))}catch(t){console.error(`Error in transition hook at stage "${e}":`,t)}}async function d(e,t,n){if(e.name===`none`||!e.name){t(),n();return}let i=s.value[e.name];if(!i){console.error(`Transition ${e.name} not found`),t(),n();return}let c=i.nextDelay===void 0?i.duration/3:i.nextDelay,d=!1,f=e=>{e===`navigation`&&!d&&(d=!0,t())},p=l(f);try{await u(`before-enter`,{transitionName:e.name}),r.value&&(await u(`before-leave`,{transitionName:a.value}),a.value=``,o.value=void 0,r.value=!1,await u(`after-leave`,{transitionName:a.value}),await new Promise(e=>setTimeout(e,50))),a.value=e.name,o.value=e,r.value=!0,await u(`enter-active`,{transitionName:name}),setTimeout(async()=>{await u(`navigation`,{transitionName:e.name,config:i}),d||(d=!0,t())},c),setTimeout(async()=>{await u(`after-enter`,{transitionName:e.name})},i.duration),setTimeout(async()=>{await u(`before-leave`,{transitionName:e.name})},i.duration+10),setTimeout(async()=>{await u(`leave-active`,{transitionName:e.name})},i.duration+20);let s=i.exitDuration??0;setTimeout(async()=>{r.value=!1,a.value=``,o.value=void 0,await u(`after-leave`,{transitionName:e.name}),n()},i.duration+s)}catch(e){console.error(e)}finally{p(),setTimeout(()=>{d||(d=!0,t())},i.duration*2)}}function f(e,t){return new Promise(n=>{d(e,t,n)})}return n.beforeEach((e,n,r)=>{if(t.disableTransitions){r();return}if(typeof e.meta.stageTransition!=`object`){r();return}let i=e.meta.stageTransition;if(t.usePageSpecificTransitions&&i.pageSpecificAvailable){r();return}t.primaryColor!==void 0&&(i.primaryColor=t.primaryColor),t.secondaryColor!==void 0&&(i.secondaryColor=t.secondaryColor),t.tertiaryColor!==void 0&&(i.tertiaryColor=t.tertiaryColor),t.colors!==void 0&&(i.colors=t.colors),t.zIndex!==void 0&&(i.zIndex=t.zIndex),f(i,r)}),(e,t)=>(to(),oo(Ya,null,[_i(e.$slots,`default`),r.value?(to(),oo(Ya,{key:0},[s.value[a.value]?(to(),so(fi(s.value[a.value].component),{key:0,"stage-transition":o.value},null,8,[`stage-transition`])):bo(``,!0)],64)):bo(``,!0)],64))}}),fX=dX; diff --git a/assets/memory-DrUUBYPC.js b/assets/memory-DkrmmiHt.js similarity index 91% rename from assets/memory-DrUUBYPC.js rename to assets/memory-DkrmmiHt.js index 062bf2503ca61456ce5d19130a791670fc43b026..611ab57a652b779994124dfc551f9f647f42c68e 100644 --- a/assets/memory-DrUUBYPC.js +++ b/assets/memory-DkrmmiHt.js @@ -1 +1 @@ -import{createBaseVNode as e,createElementBlock as t,defineComponent as n,openBlock as r,resolveDirective as i,withDirectives as a}from"./index-BSwg6FIo.js";import{route_block_default as o}from"./route-block-CC3cgg4Q.js";const s={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var c=n({__name:`index`,setup(n){return(n,o)=>{let c=i(`motion`);return a((r(),t(`div`,s,o[0]||=[e(`div`,{text:`60`,"i-solar:leaf-bold-duotone":``},null,-1)])),[[c]])}}});typeof o==`function`&&o(c);var l=c;export{l as default}; \ No newline at end of file +import{createBaseVNode as e,createElementBlock as t,defineComponent as n,openBlock as r,resolveDirective as i,withDirectives as a}from"./index-DKziOBM4.js";import{route_block_default as o}from"./route-block-CC3cgg4Q.js";const s={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var c=n({__name:`index`,setup(n){return(n,o)=>{let c=i(`motion`);return a((r(),t(`div`,s,o[0]||=[e(`div`,{text:`60`,"i-solar:leaf-bold-duotone":``},null,-1)])),[[c]])}}});typeof o==`function`&&o(c);var l=c;export{l as default}; \ No newline at end of file diff --git a/assets/memory-long-term-DUBmUqi4.js b/assets/memory-long-term-DhH1haWG.js similarity index 77% rename from assets/memory-long-term-DUBmUqi4.js rename to assets/memory-long-term-DhH1haWG.js index e8c1311a09c7d660055eed66a58892e490d8927b..45ef062e2a83a2ae2d23d887090ef4358feb4ddd 100644 --- a/assets/memory-long-term-DUBmUqi4.js +++ b/assets/memory-long-term-DhH1haWG.js @@ -1 +1 @@ -import{createElementBlock as e,defineComponent as t,openBlock as n}from"./index-BSwg6FIo.js";import{route_block_default as r}from"./route-block-CC3cgg4Q.js";var i=t({__name:`memory-long-term`,setup(t){return(t,r)=>(n(),e(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file +import{createElementBlock as e,defineComponent as t,openBlock as n}from"./index-DKziOBM4.js";import{route_block_default as r}from"./route-block-CC3cgg4Q.js";var i=t({__name:`memory-long-term`,setup(t){return(t,r)=>(n(),e(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/memory-short-term-wHAWQOw0.js b/assets/memory-short-term-ZF-2h-kI.js similarity index 77% rename from assets/memory-short-term-wHAWQOw0.js rename to assets/memory-short-term-ZF-2h-kI.js index b1d9937540a2b02e805df815bbb7f269025d4fc1..090fd7d278ec4cc4b2538f574ba98e7dae6dbc30 100644 --- a/assets/memory-short-term-wHAWQOw0.js +++ b/assets/memory-short-term-ZF-2h-kI.js @@ -1 +1 @@ -import{createElementBlock as e,defineComponent as t,openBlock as n}from"./index-BSwg6FIo.js";import{route_block_default as r}from"./route-block-CC3cgg4Q.js";var i=t({__name:`memory-short-term`,setup(t){return(t,r)=>(n(),e(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file +import{createElementBlock as e,defineComponent as t,openBlock as n}from"./index-DKziOBM4.js";import{route_block_default as r}from"./route-block-CC3cgg4Q.js";var i=t({__name:`memory-short-term`,setup(t){return(t,r)=>(n(),e(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/messages-BWcBoWro.js b/assets/messages-ChSNCEvv.js similarity index 77% rename from assets/messages-BWcBoWro.js rename to assets/messages-ChSNCEvv.js index 5a44f97a47deacb12d3c3120cb0c68e2ac89f92c..0ede2c0995a41778e1b407aad3ad184b037d2cb4 100644 --- a/assets/messages-BWcBoWro.js +++ b/assets/messages-ChSNCEvv.js @@ -1 +1 @@ -import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,ref as o,renderList as s,toDisplayString as c,unref as l}from"./index-BSwg6FIo.js";import"./src-CX9nVT7I.js";import"./Basic-BGRWPjtG.js";import{Textarea_default as u}from"./Textarea-CuugR8VV.js";import{useQueue as d}from"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import{llmInferenceEndToken as f,useMessageContentQueue as p}from"./queues-XZuprNy-.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=i({__name:`messages`,setup(i){let y=o(``),b=o([]),x=o(!1),S=d({handlers:[async e=>{b.value.push(e.data)}]}),C=p(S);async function w(){x.value=!0,C.add(y.value),C.add(f),y.value=``,x.value=!1}return(i,o)=>(a(),n(`div`,m,[t(`div`,h,[r(l(u),{modelValue:y.value,"onUpdate:modelValue":o[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),t(`button`,g,c(x.value?`Processing...`:`Send`),1)]),t(`div`,_,[t(`div`,v,[o[1]||=t(`h3`,{"font-semibold":``},` TTS Message `,-1),(a(!0),n(e,null,s(b.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e),1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file +import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,ref as o,renderList as s,toDisplayString as c,unref as l}from"./index-DKziOBM4.js";import"./src-CmPNYgc5.js";import"./Basic-C8g-kAol.js";import{Textarea_default as u}from"./Textarea-BIh0Stpi.js";import"./sleep-JdatAils.js";import{useQueue as d}from"./queue-D6mkPVC_.js";import{llmInferenceEndToken as f,useMessageContentQueue as p}from"./queues-BZSFjE0u.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=i({__name:`messages`,setup(i){let y=o(``),b=o([]),x=o(!1),S=d({handlers:[async e=>{b.value.push(e.data)}]}),C=p(S);async function w(){x.value=!0,C.add(y.value),C.add(f),y.value=``,x.value=!1}return(i,o)=>(a(),n(`div`,m,[t(`div`,h,[r(l(u),{modelValue:y.value,"onUpdate:modelValue":o[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),t(`button`,g,c(x.value?`Processing...`:`Send`),1)]),t(`div`,_,[t(`div`,v,[o[1]||=t(`h3`,{"font-semibold":``},` TTS Message `,-1),(a(!0),n(e,null,s(b.value,e=>(a(),n(`div`,{key:e},[t(`div`,null,c(e),1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/microsoft-speech-D91uNSKl.js b/assets/microsoft-speech-BzMvh9G0.js similarity index 84% rename from assets/microsoft-speech-D91uNSKl.js rename to assets/microsoft-speech-BzMvh9G0.js index 8609089369554768b1879d5b22fe26d9dbb0cba7..5a14a477da0b5f1b30352e07e78586d50572c91c 100644 --- a/assets/microsoft-speech-D91uNSKl.js +++ b/assets/microsoft-speech-BzMvh9G0.js @@ -1 +1 @@ -import{computed as e,createBaseVNode as t,createBlock as n,createVNode as r,defineComponent as i,onMounted as a,openBlock as o,ref as s,storeToRefs as c,unref as l,useI18n as u,watch as d,withCtx as f}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import{FieldInput_default as h,FieldRange_default as g}from"./src-CX9nVT7I.js";import{SpeechPlayground_default as _,SpeechProviderSettings_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`;var C=i({__name:`microsoft-speech`,setup(i){let{t:y}=u(),C={pitch:0,speed:1,volume:0},w=m(),T=p(),{providers:E}=c(T),D=s(0),O=s(1),k=s(0),A=e({get:()=>{var e;return(e=E.value[x])?.region||`eastasia`},set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=e(()=>{var e;return!!(e=E.value[x])?.apiKey}),M=e(()=>w.availableVoices[x]||[]);a(async()=>{await w.loadVoicesForProvider(x)}),d([j,A],async()=>{await w.loadVoicesForProvider(x)});async function N(e,t,n){let r=T.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=T.getProviderConfig(x),a=i.model||S,o={...i,region:A.value,disableSsml:!n};if(!n&&t){let n=M.value.find(e=>e.id===t);if(n){let s=w.generateSSML(e,n,{...i,pitch:D.value});return await w.speech(r,a,s,t,o)}}return await w.speech(r,a,e,t,o)}return(e,i)=>(o(),n(l(v),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":f(()=>[r(l(h),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,label:l(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.label`),description:l(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.description`),placeholder:`eastasia`,required:``,type:`text`},null,8,[`modelValue`,`label`,`description`])]),"voice-settings":f(()=>[t(`div`,b,[r(l(g),{modelValue:D.value,"onUpdate:modelValue":i[1]||=e=>D.value=e,label:l(y)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:l(y)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),r(l(g),{modelValue:O.value,"onUpdate:modelValue":i[2]||=e=>O.value=e,label:l(y)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(y)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(g),{modelValue:k.value,"onUpdate:modelValue":i[3]||=e=>k.value=e,label:l(y)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:l(y)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:f(()=>[r(l(_),{"available-voices":M.value,"generate-speech":N,"api-key-configured":j.value,"default-text":`Hello! This is a test of the Microsoft Speech synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file +import{computed as e,createBaseVNode as t,createBlock as n,createVNode as r,defineComponent as i,onMounted as a,openBlock as o,ref as s,storeToRefs as c,unref as l,useI18n as u,watch as d,withCtx as f}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import{FieldInput_default as h,FieldRange_default as g}from"./src-CmPNYgc5.js";import{SpeechPlayground_default as _,SpeechProviderSettings_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`;var C=i({__name:`microsoft-speech`,setup(i){let{t:y}=u(),C={pitch:0,speed:1,volume:0},w=m(),T=p(),{providers:E}=c(T),D=s(0),O=s(1),k=s(0),A=e({get:()=>{var e;return(e=E.value[x])?.region||`eastasia`},set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=e(()=>{var e;return!!(e=E.value[x])?.apiKey}),M=e(()=>w.availableVoices[x]||[]);a(async()=>{await w.loadVoicesForProvider(x)}),d([j,A],async()=>{await w.loadVoicesForProvider(x)});async function N(e,t,n){let r=T.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=T.getProviderConfig(x),a=i.model||S,o={...i,region:A.value,disableSsml:!n};if(!n&&t){let n=M.value.find(e=>e.id===t);if(n){let s=w.generateSSML(e,n,{...i,pitch:D.value});return await w.speech(r,a,s,t,o)}}return await w.speech(r,a,e,t,o)}return(e,i)=>(o(),n(l(v),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":f(()=>[r(l(h),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,label:l(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.label`),description:l(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.description`),placeholder:`eastasia`,required:``,type:`text`},null,8,[`modelValue`,`label`,`description`])]),"voice-settings":f(()=>[t(`div`,b,[r(l(g),{modelValue:D.value,"onUpdate:modelValue":i[1]||=e=>D.value=e,label:l(y)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:l(y)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),r(l(g),{modelValue:O.value,"onUpdate:modelValue":i[2]||=e=>O.value=e,label:l(y)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(y)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),r(l(g),{modelValue:k.value,"onUpdate:modelValue":i[3]||=e=>k.value=e,label:l(y)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:l(y)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:f(()=>[r(l(_),{"available-voices":M.value,"generate-speech":N,"api-key-configured":j.value,"default-text":`Hello! This is a test of the Microsoft Speech synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/mistral-ai-B6ubU7d4.js b/assets/mistral-ai-BfFFEoJ2.js similarity index 82% rename from assets/mistral-ai-B6ubU7d4.js rename to assets/mistral-ai-BfFFEoJ2.js index f7d1b78074e4cff5c30aecbececd6704c3679b2d..447488baa872cad944abfff4130d784bd43b4f83 100644 --- a/assets/mistral-ai-B6ubU7d4.js +++ b/assets/mistral-ai-BfFFEoJ2.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`mistral-ai`;var x=r({__name:`mistral-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon-color":(o=w.value)?.iconColor,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`mis-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.mistral.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`mistral-ai`;var x=r({__name:`mistral-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon-color":(o=w.value)?.iconColor,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`mis-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.mistral.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/models-BJIpJbS2.js b/assets/models-76vvgGXm.js similarity index 89% rename from assets/models-BJIpJbS2.js rename to assets/models-76vvgGXm.js index a6b0090e432da06763bdb1cfd21cb76f0a67881c..1198b2e21eca5b997b8785f2f107576bd9f1588e 100644 --- a/assets/models-BJIpJbS2.js +++ b/assets/models-76vvgGXm.js @@ -1 +1 @@ -import{Fragment as e,__plugin_vue_export_helper_default as t,__toESM as n,createBaseVNode as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createTextVNode as s,createVNode as c,defineComponent as l,openBlock as u,ref as d,renderList as f,renderSlot as p,resolveDirective as m,storeToRefs as h,toDisplayString as g,unref as _,useElementBounding as v,useFileDialog as y,useI18n as b,useMouse as x,useObjectUrl as S,useSettings as C,vModelSelect as w,vModelText as T,watch as E,withCtx as D,withDirectives as O}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import"./dist-BziUufTI.js";import{Canvas_default as k,Model_default as A,Section_default as j,require_jszip_min as M,require_localforage as N}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import{Emotion as P,EmotionNeutralMotionName as F}from"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{Vibrant as I}from"./browser-_6RX04wP.js";import{route_block_default as L}from"./route-block-CC3cgg4Q.js";import{ColorPalette_default as R}from"./ColorPalette-BdHvvd1C.js";import{IconAnimation_default as z}from"./IconAnimation-LJjhLEIS.js";import{useIconAnimation as B}from"./useIconAnimation-DBzeTvDN.js";const V=[`disabled`];var H=l({__name:`Live2DModelControlButton`,emits:[`click`],setup(e){let t=C();return(e,n)=>(u(),o(`button`,{disabled:_(t).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]||=t=>e.$emit(`click`)},[p(e.$slots,`default`)],8,V))}}),U=H,W=n(M()),G=n(N());const K={flex:`~ col gap-2`},q={flex:``,"items-center":``,"gap-2":``},J=[`disabled`,`placeholder`],Y={"font-medium":``,"font-mono":``},X={flex:``,"gap-2":``},Z=[`onUpdate:modelValue`],Q=[`href`,`download`];var ee=l({__name:`Live2DSettings`,props:{palette:null},emits:[`extractColorsFromModel`],setup(t){let{t:n}=b(),l=y({accept:`application/zip`}),p=C(),{live2dModelFile:m,live2dMotionMap:v,live2dLoadSource:x,loadingLive2dModel:k,availableLive2dMotions:A,live2dModelUrl:M}=h(p),N=d(M.value);l.onChange(e=>{e&&e.length>0&&(v.value={},m.value=e[0],x.value=`file`,k.value=!0)}),E(()=>p.loadingLive2dModel,e=>{e||x.value===`file`&&A.value.forEach(e=>{e.motionName in P?v.value[e.fileName]=e.motionName:v.value[e.fileName]=F})});async function I(e,t){if(!Object.keys(t).length)return e;let n=new W.default,r=await n.loadAsync(e),i=Object.keys(r.files).find(e=>e.endsWith(`model3.json`));if(!i)throw Error(`model3.json not found`);let a=await r.file(i).async(`string`),o=JSON.parse(a),s={};Object.entries(t).forEach(([e,t])=>{if(s[t]){s[t].push({File:e});return}s[t]=[{File:e}]}),o.FileReferences.Motions=s,r.file(i,JSON.stringify(o,null,2));let c=await r.generateAsync({type:`blob`});return new File([c],e.name,{type:e.type,lastModified:e.lastModified})}async function L(){let e=await G.default.getItem(`live2dModel`);if(!e)return;let t=await I(e,v.value);m.value=t,x.value=`file`,k.value=!0}let z=S(m);return(d,m)=>(u(),o(`div`,K,[c(_(j),{title:_(n)(`settings.live2d.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`},{default:D(()=>[r(`div`,q,[O(r(`input`,{"onUpdate:modelValue":m[0]||=e=>N.value=e,disabled:_(p).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:_(n)(`settings.live2d.change-model.from-url-placeholder`)},null,8,J),[[T,N.value]]),c(U,{class:`form-control`,onClick:m[1]||=e=>M.value=N.value},{default:D(()=>[s(g(_(n)(`settings.live2d.change-model.from-url`)),1)]),_:1})]),c(U,{class:`form-control place-self-end`,onClick:m[2]||=e=>_(l).open()},{default:D(()=>[s(g(_(n)(`settings.live2d.change-model.from-file`))+`... `,1)]),_:1}),c(U,{class:`form-control`,onClick:m[3]||=e=>d.$emit(`extractColorsFromModel`)},{default:D(()=>m[4]||=[s(` Extract colors from model `)]),_:1,__:[4]}),c(R,{colors:t.palette.map(e=>({hex:e,name:e}))},null,8,[`colors`])]),_:1},8,[`title`]),_(p).live2dLoadSource===`file`?(u(),i(_(j),{key:0,title:_(n)(`settings.live2d.edit-motion-map.title`),icon:`i-solar:face-scan-circle-bold-duotone`},{default:D(()=>{var t;return[(u(!0),o(e,null,f(_(p).availableLive2dMotions,t=>(u(),o(`div`,{key:t.fileName,flex:``,"items-center":``,"justify-between":``,"text-sm":``},[r(`span`,Y,g(t.fileName),1),r(`div`,X,[O(r(`select`,{"onUpdate:modelValue":e=>_(p).live2dMotionMap[t.fileName]=e},[(u(!0),o(e,null,f(Object.keys(_(P)),e=>(u(),o(`option`,{key:e},g(e),1))),128))],8,Z),[[w,_(p).live2dMotionMap[t.fileName]]]),c(U,{class:`form-control`,onClick:e=>_(p).live2dCurrentMotion={group:t.motionName,index:t.motionIndex}},{default:D(()=>m[5]||=[s(` Play `)]),_:2,__:[5]},1032,[`onClick`])])]))),128)),c(U,{onClick:L},{default:D(()=>m[6]||=[s(` Save and patch `)]),_:1,__:[6]}),r(`a`,{"mt-2":``,block:``,href:_(z),download:`${(t=_(p).live2dModelFile)?.name||`live2d`}-motion-edited.zip`},[c(U,{"w-full":``},{default:D(()=>m[7]||=[s(`Export`)]),_:1,__:[7]})],8,Q)]}),_:1},8,[`title`])):a(``,!0)]))}}),te=t(ee,[[`__scopeId`,`data-v-559b50a9`]]);const ne={flex:``,class:`flex-col-reverse sm:flex-row`},re={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var $=l({__name:`index`,setup(t){let n=d(),a=d(),{width:s,height:l}=v(n),f=d([]);async function p(){if(!a.value)return;let e=await a.value.captureFrame();if(!e){console.error(`No frame captured`);return}let t=URL.createObjectURL(e);try{let e=new I(t),n=await e.getPalette();f.value=Object.values(n).map(e=>e?.hex).filter(e=>typeof e==`string`)}finally{URL.revokeObjectURL(t)}}let{iconAnimationStarted:h,showIconAnimation:g,animationIcon:y}=B(`i-solar:people-nearby-bold-duotone`),b=x();return(t,d)=>{let v=m(`motion`);return u(),o(e,null,[r(`div`,ne,[r(`div`,{ref_key:`live2dContainerRef`,ref:n,w:`100% sm:50%`,h:`50dvh sm:80dvh`},[c(_(k),{ref_key:`live2dCanvasRef`,ref:a,width:_(s),height:_(l),resolution:2,"max-h":`100dvh`},{default:D(({app:e})=>[c(_(A),{app:e,"mouth-open-size":0,width:_(s),height:_(l),paused:!1,"focus-at":{x:_(b).x.value,y:_(b).y.value}},null,8,[`app`,`width`,`height`,`focus-at`])]),_:1},8,[`width`,`height`])],512),c(te,{w:`100% sm:50%`,h:`50dvh sm:80dvh`,palette:f.value,onExtractColorsFromModel:p},null,8,[`palette`])]),_(g)?(u(),i(z,{key:0,"z-index":-1,icon:_(y),"icon-size":12,duration:1e3,started:_(h),"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((u(),o(`div`,re,d[0]||=[r(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)])),[[v]])],64)}}});typeof L==`function`&&L($);var ie=$;export{ie as default}; \ No newline at end of file +import{Fragment as e,__plugin_vue_export_helper_default as t,__toESM as n,createBaseVNode as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createTextVNode as s,createVNode as c,defineComponent as l,openBlock as u,ref as d,renderList as f,renderSlot as p,resolveDirective as m,storeToRefs as h,toDisplayString as g,unref as _,useElementBounding as v,useFileDialog as y,useI18n as b,useMouse as x,useObjectUrl as S,useSettings as C,vModelSelect as w,vModelText as T,watch as E,withCtx as D,withDirectives as O}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import"./dist-B_AZqzk2.js";import{Canvas_default as k,Model_default as A,Section_default as j,require_jszip_min as M,require_localforage as N}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import{Emotion as P,EmotionNeutralMotionName as F}from"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{Vibrant as I}from"./browser-_6RX04wP.js";import{route_block_default as L}from"./route-block-CC3cgg4Q.js";import{ColorPalette_default as R}from"./ColorPalette-BB1UoLey.js";import{IconAnimation_default as z}from"./IconAnimation-D-xhKJXy.js";import{useIconAnimation as B}from"./useIconAnimation-DZK17st3.js";const V=[`disabled`];var H=l({__name:`Live2DModelControlButton`,emits:[`click`],setup(e){let t=C();return(e,n)=>(u(),o(`button`,{disabled:_(t).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]||=t=>e.$emit(`click`)},[p(e.$slots,`default`)],8,V))}}),U=H,W=n(M()),G=n(N());const K={flex:`~ col gap-2`},q={flex:``,"items-center":``,"gap-2":``},J=[`disabled`,`placeholder`],Y={"font-medium":``,"font-mono":``},X={flex:``,"gap-2":``},Z=[`onUpdate:modelValue`],Q=[`href`,`download`];var ee=l({__name:`Live2DSettings`,props:{palette:null},emits:[`extractColorsFromModel`],setup(t){let{t:n}=b(),l=y({accept:`application/zip`}),p=C(),{live2dModelFile:m,live2dMotionMap:v,live2dLoadSource:x,loadingLive2dModel:k,availableLive2dMotions:A,live2dModelUrl:M}=h(p),N=d(M.value);l.onChange(e=>{e&&e.length>0&&(v.value={},m.value=e[0],x.value=`file`,k.value=!0)}),E(()=>p.loadingLive2dModel,e=>{e||x.value===`file`&&A.value.forEach(e=>{e.motionName in P?v.value[e.fileName]=e.motionName:v.value[e.fileName]=F})});async function I(e,t){if(!Object.keys(t).length)return e;let n=new W.default,r=await n.loadAsync(e),i=Object.keys(r.files).find(e=>e.endsWith(`model3.json`));if(!i)throw Error(`model3.json not found`);let a=await r.file(i).async(`string`),o=JSON.parse(a),s={};Object.entries(t).forEach(([e,t])=>{if(s[t]){s[t].push({File:e});return}s[t]=[{File:e}]}),o.FileReferences.Motions=s,r.file(i,JSON.stringify(o,null,2));let c=await r.generateAsync({type:`blob`});return new File([c],e.name,{type:e.type,lastModified:e.lastModified})}async function L(){let e=await G.default.getItem(`live2dModel`);if(!e)return;let t=await I(e,v.value);m.value=t,x.value=`file`,k.value=!0}let z=S(m);return(d,m)=>(u(),o(`div`,K,[c(_(j),{title:_(n)(`settings.live2d.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`},{default:D(()=>[r(`div`,q,[O(r(`input`,{"onUpdate:modelValue":m[0]||=e=>N.value=e,disabled:_(p).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:_(n)(`settings.live2d.change-model.from-url-placeholder`)},null,8,J),[[T,N.value]]),c(U,{class:`form-control`,onClick:m[1]||=e=>M.value=N.value},{default:D(()=>[s(g(_(n)(`settings.live2d.change-model.from-url`)),1)]),_:1})]),c(U,{class:`form-control place-self-end`,onClick:m[2]||=e=>_(l).open()},{default:D(()=>[s(g(_(n)(`settings.live2d.change-model.from-file`))+`... `,1)]),_:1}),c(U,{class:`form-control`,onClick:m[3]||=e=>d.$emit(`extractColorsFromModel`)},{default:D(()=>m[4]||=[s(` Extract colors from model `)]),_:1,__:[4]}),c(R,{colors:t.palette.map(e=>({hex:e,name:e}))},null,8,[`colors`])]),_:1},8,[`title`]),_(p).live2dLoadSource===`file`?(u(),i(_(j),{key:0,title:_(n)(`settings.live2d.edit-motion-map.title`),icon:`i-solar:face-scan-circle-bold-duotone`},{default:D(()=>{var t;return[(u(!0),o(e,null,f(_(p).availableLive2dMotions,t=>(u(),o(`div`,{key:t.fileName,flex:``,"items-center":``,"justify-between":``,"text-sm":``},[r(`span`,Y,g(t.fileName),1),r(`div`,X,[O(r(`select`,{"onUpdate:modelValue":e=>_(p).live2dMotionMap[t.fileName]=e},[(u(!0),o(e,null,f(Object.keys(_(P)),e=>(u(),o(`option`,{key:e},g(e),1))),128))],8,Z),[[w,_(p).live2dMotionMap[t.fileName]]]),c(U,{class:`form-control`,onClick:e=>_(p).live2dCurrentMotion={group:t.motionName,index:t.motionIndex}},{default:D(()=>m[5]||=[s(` Play `)]),_:2,__:[5]},1032,[`onClick`])])]))),128)),c(U,{onClick:L},{default:D(()=>m[6]||=[s(` Save and patch `)]),_:1,__:[6]}),r(`a`,{"mt-2":``,block:``,href:_(z),download:`${(t=_(p).live2dModelFile)?.name||`live2d`}-motion-edited.zip`},[c(U,{"w-full":``},{default:D(()=>m[7]||=[s(`Export`)]),_:1,__:[7]})],8,Q)]}),_:1},8,[`title`])):a(``,!0)]))}}),te=t(ee,[[`__scopeId`,`data-v-559b50a9`]]);const ne={flex:``,class:`flex-col-reverse sm:flex-row`},re={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var $=l({__name:`index`,setup(t){let n=d(),a=d(),{width:s,height:l}=v(n),f=d([]);async function p(){if(!a.value)return;let e=await a.value.captureFrame();if(!e){console.error(`No frame captured`);return}let t=URL.createObjectURL(e);try{let e=new I(t),n=await e.getPalette();f.value=Object.values(n).map(e=>e?.hex).filter(e=>typeof e==`string`)}finally{URL.revokeObjectURL(t)}}let{iconAnimationStarted:h,showIconAnimation:g,animationIcon:y}=B(`i-solar:people-nearby-bold-duotone`),b=x();return(t,d)=>{let v=m(`motion`);return u(),o(e,null,[r(`div`,ne,[r(`div`,{ref_key:`live2dContainerRef`,ref:n,w:`100% sm:50%`,h:`50dvh sm:80dvh`},[c(_(k),{ref_key:`live2dCanvasRef`,ref:a,width:_(s),height:_(l),resolution:2,"max-h":`100dvh`},{default:D(({app:e})=>[c(_(A),{app:e,"mouth-open-size":0,width:_(s),height:_(l),paused:!1,"focus-at":{x:_(b).x.value,y:_(b).y.value}},null,8,[`app`,`width`,`height`,`focus-at`])]),_:1},8,[`width`,`height`])],512),c(te,{w:`100% sm:50%`,h:`50dvh sm:80dvh`,palette:f.value,onExtractColorsFromModel:p},null,8,[`palette`])]),_(g)?(u(),i(z,{key:0,"z-index":-1,icon:_(y),"icon-size":12,duration:1e3,started:_(h),"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((u(),o(`div`,re,d[0]||=[r(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)])),[[v]])],64)}}});typeof L==`function`&&L($);var ie=$;export{ie as default}; \ No newline at end of file diff --git a/assets/modules-oFdrgpO7.js b/assets/modules-BnTzg3CJ.js similarity index 86% rename from assets/modules-oFdrgpO7.js rename to assets/modules-BnTzg3CJ.js index 3576421e397a821331030c3a087de3180ee810a2..22cb94640d7242c7d62c8e6390afe5d4eadc81ab 100644 --- a/assets/modules-oFdrgpO7.js +++ b/assets/modules-BnTzg3CJ.js @@ -1 +1 @@ -import{Fragment as e,computed as t,createBaseVNode as n,createBlock as r,createElementBlock as i,defineComponent as a,openBlock as o,renderList as s,resolveDirective as c,unref as l,useI18n as u,withDirectives as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{IconStatusItem_default as f}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as p}from"./route-block-CC3cgg4Q.js";import{IconAnimation_default as m}from"./IconAnimation-LJjhLEIS.js";import{useIconAnimation as h}from"./useIconAnimation-DBzeTvDN.js";const g={grid:`~ cols-1 sm:cols-2 gap-4`},_={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var v=a({__name:`index`,setup(a){let{t:p}=u(),v=t(()=>[{id:`consciousness`,name:p(`settings.pages.modules.consciousness.title`),description:p(`settings.pages.modules.consciousness.description`),icon:`i-solar:ghost-bold-duotone`,to:`/settings/modules/consciousness`,configured:!1},{id:`speech`,name:p(`settings.pages.modules.speech.title`),description:p(`settings.pages.modules.speech.description`),icon:`i-solar:user-speak-rounded-bold-duotone`,to:`/settings/modules/speech`,configured:!1},{id:`hearing`,name:p(`settings.pages.modules.hearing.title`),description:p(`settings.pages.modules.hearing.description`),icon:`i-solar:microphone-3-bold-duotone`,to:``,configured:!1},{id:`vision`,name:p(`settings.pages.modules.vision.title`),description:p(`settings.pages.modules.vision.description`),icon:`i-solar:eye-closed-bold-duotone`,to:``,configured:!1},{id:`memory-short-term`,name:p(`settings.pages.modules.memory-short-term.title`),description:p(`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:p(`settings.pages.modules.memory-long-term.title`),description:p(`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:p(`settings.pages.modules.messaging-discord.title`),description:p(`settings.pages.modules.messaging-discord.description`),icon:`i-simple-icons:discord`,to:``,configured:!1},{id:`x`,name:p(`settings.pages.modules.x.title`),description:p(`settings.pages.modules.x.description`),icon:`i-simple-icons:x`,to:``,configured:!1},{id:`game-minecraft`,name:p(`settings.pages.modules.gaming-minecraft.title`),description:p(`settings.pages.modules.gaming-minecraft.description`),iconColor:`i-vscode-icons:file-type-minecraft`,to:``,configured:!1},{id:`game-factorio`,name:p(`settings.pages.modules.gaming-factorio.title`),description:p(`settings.pages.modules.gaming-factorio.description`),iconImage:``,to:``,configured:!1}]),{iconAnimationStarted:y,showIconAnimation:b,animationIcon:x}=h(`i-solar:layers-bold-duotone`);return(t,a)=>{let u=c(`motion`);return o(),i(e,null,[n(`div`,g,[(o(!0),i(e,null,s(v.value,(e,t)=>d((o(),r(l(f),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*50,title:e.name,description:e.description,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:e.to,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[u]])),128))]),l(b)?(o(),r(m,{key:0,icon:l(x),"icon-size":12,duration:1e3,started:l(y),"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`])):d((o(),i(`div`,_,a[0]||=[n(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)])),[[u]])],64)}}});typeof p==`function`&&p(v);var y=v;export{y as default}; \ No newline at end of file +import{Fragment as e,computed as t,createBaseVNode as n,createBlock as r,createElementBlock as i,defineComponent as a,openBlock as o,renderList as s,resolveDirective as c,unref as l,useI18n as u,withDirectives as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{IconStatusItem_default as f}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as p}from"./route-block-CC3cgg4Q.js";import{IconAnimation_default as m}from"./IconAnimation-D-xhKJXy.js";import{useIconAnimation as h}from"./useIconAnimation-DZK17st3.js";const g={grid:`~ cols-1 sm:cols-2 gap-4`},_={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var v=a({__name:`index`,setup(a){let{t:p}=u(),v=t(()=>[{id:`consciousness`,name:p(`settings.pages.modules.consciousness.title`),description:p(`settings.pages.modules.consciousness.description`),icon:`i-solar:ghost-bold-duotone`,to:`/settings/modules/consciousness`,configured:!1},{id:`speech`,name:p(`settings.pages.modules.speech.title`),description:p(`settings.pages.modules.speech.description`),icon:`i-solar:user-speak-rounded-bold-duotone`,to:`/settings/modules/speech`,configured:!1},{id:`hearing`,name:p(`settings.pages.modules.hearing.title`),description:p(`settings.pages.modules.hearing.description`),icon:`i-solar:microphone-3-bold-duotone`,to:``,configured:!1},{id:`vision`,name:p(`settings.pages.modules.vision.title`),description:p(`settings.pages.modules.vision.description`),icon:`i-solar:eye-closed-bold-duotone`,to:``,configured:!1},{id:`memory-short-term`,name:p(`settings.pages.modules.memory-short-term.title`),description:p(`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:p(`settings.pages.modules.memory-long-term.title`),description:p(`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:p(`settings.pages.modules.messaging-discord.title`),description:p(`settings.pages.modules.messaging-discord.description`),icon:`i-simple-icons:discord`,to:``,configured:!1},{id:`x`,name:p(`settings.pages.modules.x.title`),description:p(`settings.pages.modules.x.description`),icon:`i-simple-icons:x`,to:``,configured:!1},{id:`game-minecraft`,name:p(`settings.pages.modules.gaming-minecraft.title`),description:p(`settings.pages.modules.gaming-minecraft.description`),iconColor:`i-vscode-icons:file-type-minecraft`,to:``,configured:!1},{id:`game-factorio`,name:p(`settings.pages.modules.gaming-factorio.title`),description:p(`settings.pages.modules.gaming-factorio.description`),iconImage:``,to:``,configured:!1}]),{iconAnimationStarted:y,showIconAnimation:b,animationIcon:x}=h(`i-solar:layers-bold-duotone`);return(t,a)=>{let u=c(`motion`);return o(),i(e,null,[n(`div`,g,[(o(!0),i(e,null,s(v.value,(e,t)=>d((o(),r(l(f),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*50,title:e.name,description:e.description,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:e.to,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[u]])),128))]),l(b)?(o(),r(m,{key:0,icon:l(x),"icon-size":12,duration:1e3,started:l(y),"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`])):d((o(),i(`div`,_,a[0]||=[n(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)])),[[u]])],64)}}});typeof p==`function`&&p(v);var y=v;export{y as default}; \ No newline at end of file diff --git a/assets/moonshot-ai-Gb1o961w.js b/assets/moonshot-ai-UFXQvwF7.js similarity index 82% rename from assets/moonshot-ai-Gb1o961w.js rename to assets/moonshot-ai-UFXQvwF7.js index 15de5a2edbb8e304da6713861cae5ac1e92a7c17..befd810e479658491054bab12b26ad66b213bace 100644 --- a/assets/moonshot-ai-Gb1o961w.js +++ b/assets/moonshot-ai-UFXQvwF7.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`moonshot-ai`;var x=r({__name:`moonshot-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`ms-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.moonshot.cn/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`moonshot-ai`;var x=r({__name:`moonshot-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`ms-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.moonshot.cn/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/novita-ai-DZ-Vz6US.js b/assets/novita-ai-CHDoxp4K.js similarity index 82% rename from assets/novita-ai-DZ-Vz6US.js rename to assets/novita-ai-CHDoxp4K.js index 00b11ba8089fcb722cce5c00de0f280c5e331b4c..68ec332e394db039b8e4d8e9d804e4ce3c54d86d 100644 --- a/assets/novita-ai-DZ-Vz6US.js +++ b/assets/novita-ai-CHDoxp4K.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`novita-ai`;var x=r({__name:`novita-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon-color":(o=w.value)?.iconColor,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`nvt-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.novita.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`novita-ai`;var x=r({__name:`novita-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon-color":(o=w.value)?.iconColor,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`nvt-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.novita.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/ollama-NSTufMsI.js b/assets/ollama-cl0Rrnvz.js similarity index 84% rename from assets/ollama-NSTufMsI.js rename to assets/ollama-cl0Rrnvz.js index 47fe67b25a73f074d67a970c2769e21541a13fd3..9ffac346d2cc13fd5dfcd68c0d988ebfa2f034b4 100644 --- a/assets/ollama-NSTufMsI.js +++ b/assets/ollama-cl0Rrnvz.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,ref as o,storeToRefs as s,unref as c,useI18n as l,useRouter as u,watch as d,withCtx as f}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import{FieldKeyValues_default as m}from"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as h,ProviderBaseUrlInput_default as g,ProviderBasicSettings_default as _,ProviderSettingsContainer_default as v,ProviderSettingsLayout_default as y}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as b}from"./route-block-CC3cgg4Q.js";const x=`ollama`;var S=r({__name:`ollama`,setup(r){let{t:b}=l(),S=u(),C=p(),{providers:w}=s(C),T=e(()=>C.getProviderMetadata(x)),E=e({get:()=>{var e,t,n;return(e=w.value[x])?.baseUrl||((t=T.value)==null||(n=t.defaultOptions)==null?void 0:n.call(t).baseUrl)||``},set:e=>{w.value[x]||(w.value[x]={}),w.value[x].baseUrl=e}});i(()=>{var e,t,n,r;C.initializeProvider(x),E.value=(e=w.value[x])?.baseUrl||((t=T.value)==null||(n=t.defaultOptions)==null?void 0:n.call(t).baseUrl)||``,(r=w.value[x])?.headers||(w.value[x].headers={})});function D(){var e;w.value[x]={...(e=T.value)?.defaultOptions}}let O=o([{key:``,value:``}]);function k(e,t,n){e&&e.push({key:t,value:n})}function A(e,t){t&&(t.length===1?(t[0].key=``,t[0].value=``):t.splice(e,1))}return d(O,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``})},{deep:!0,immediate:!0}),(e,r)=>{var i,o;return a(),t(c(y),{"provider-name":(i=T.value)?.localizedName,"provider-icon":(o=T.value)?.icon,"on-back":()=>c(S).back()},{default:f(()=>[n(c(v),null,{default:f(()=>[n(c(_),{title:c(b)(`settings.pages.providers.common.section.basic.title`),description:c(b)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:f(()=>{var e,t;return[n(c(g),{modelValue:E.value,"onUpdate:modelValue":r[0]||=e=>E.value=e,placeholder:((e=T.value)==null||(t=e.defaultOptions)==null?void 0:t.call(e).baseUrl)||``,required:``},null,8,[`modelValue`,`placeholder`])]}),_:1},8,[`title`,`description`]),n(c(h),{title:c(b)(`settings.pages.providers.common.section.advanced.title`)},{default:f(()=>[n(c(m),{modelValue:O.value,"onUpdate:modelValue":r[1]||=e=>O.value=e,label:c(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.label`),description:c(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.description`),"key-placeholder":c(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder`),"value-placeholder":c(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder`),onAdd:r[2]||=(e,t)=>k(O.value,e,t),onRemove:r[3]||=e=>A(e,O.value)},null,8,[`modelValue`,`label`,`description`,`key-placeholder`,`value-placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof b==`function`&&b(S);var C=S;export{C as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,ref as o,storeToRefs as s,unref as c,useI18n as l,useRouter as u,watch as d,withCtx as f}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import{FieldKeyValues_default as m}from"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as h,ProviderBaseUrlInput_default as g,ProviderBasicSettings_default as _,ProviderSettingsContainer_default as v,ProviderSettingsLayout_default as y}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as b}from"./route-block-CC3cgg4Q.js";const x=`ollama`;var S=r({__name:`ollama`,setup(r){let{t:b}=l(),S=u(),C=p(),{providers:w}=s(C),T=e(()=>C.getProviderMetadata(x)),E=e({get:()=>{var e,t,n;return(e=w.value[x])?.baseUrl||((t=T.value)==null||(n=t.defaultOptions)==null?void 0:n.call(t).baseUrl)||``},set:e=>{w.value[x]||(w.value[x]={}),w.value[x].baseUrl=e}});i(()=>{var e,t,n,r;C.initializeProvider(x),E.value=(e=w.value[x])?.baseUrl||((t=T.value)==null||(n=t.defaultOptions)==null?void 0:n.call(t).baseUrl)||``,(r=w.value[x])?.headers||(w.value[x].headers={})});function D(){var e;w.value[x]={...(e=T.value)?.defaultOptions}}let O=o([{key:``,value:``}]);function k(e,t,n){e&&e.push({key:t,value:n})}function A(e,t){t&&(t.length===1?(t[0].key=``,t[0].value=``):t.splice(e,1))}return d(O,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``})},{deep:!0,immediate:!0}),(e,r)=>{var i,o;return a(),t(c(y),{"provider-name":(i=T.value)?.localizedName,"provider-icon":(o=T.value)?.icon,"on-back":()=>c(S).back()},{default:f(()=>[n(c(v),null,{default:f(()=>[n(c(_),{title:c(b)(`settings.pages.providers.common.section.basic.title`),description:c(b)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:f(()=>{var e,t;return[n(c(g),{modelValue:E.value,"onUpdate:modelValue":r[0]||=e=>E.value=e,placeholder:((e=T.value)==null||(t=e.defaultOptions)==null?void 0:t.call(e).baseUrl)||``,required:``},null,8,[`modelValue`,`placeholder`])]}),_:1},8,[`title`,`description`]),n(c(h),{title:c(b)(`settings.pages.providers.common.section.advanced.title`)},{default:f(()=>[n(c(m),{modelValue:O.value,"onUpdate:modelValue":r[1]||=e=>O.value=e,label:c(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.label`),description:c(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.description`),"key-placeholder":c(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder`),"value-placeholder":c(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder`),onAdd:r[2]||=(e,t)=>k(O.value,e,t),onRemove:r[3]||=e=>A(e,O.value)},null,8,[`modelValue`,`label`,`description`,`key-placeholder`,`value-placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof b==`function`&&b(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/openai-CRDWRKN8.js b/assets/openai-CdWtYSM3.js similarity index 83% rename from assets/openai-CRDWRKN8.js rename to assets/openai-CdWtYSM3.js index d2abf516180fe5ba20d28482196da168fb73429a..236caf09d244bada6042a5143e532b25eb808c33 100644 --- a/assets/openai-CRDWRKN8.js +++ b/assets/openai-CdWtYSM3.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`openai`;var x=r({__name:`openai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||`https://api.openai.com/v1/`},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||`https://api.openai.com/v1/`}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName||`OpenAI`,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`openai`;var x=r({__name:`openai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||`https://api.openai.com/v1/`},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||`https://api.openai.com/v1/`}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName||`OpenAI`,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/openai-audio-speech-CstZTITX.js b/assets/openai-audio-speech-92ozaSwL.js similarity index 83% rename from assets/openai-audio-speech-CstZTITX.js rename to assets/openai-audio-speech-92ozaSwL.js index d3f8953e8583e7588ee2834e579d7980f3ca5274..464fffd4bda462ae7496f6de6db1500f09398dc4 100644 --- a/assets/openai-audio-speech-CstZTITX.js +++ b/assets/openai-audio-speech-92ozaSwL.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`openai`;var x=r({__name:`openai-audio-speech`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||`https://api.openai.com/v1/`},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||`https://api.openai.com/v1/`}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName||`OpenAI`,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`openai`;var x=r({__name:`openai-audio-speech`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||`https://api.openai.com/v1/`},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||`https://api.openai.com/v1/`}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName||`OpenAI`,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/openai-audio-transcription-IjkiOEt-.js b/assets/openai-audio-transcription-CWLk8_6R.js similarity index 83% rename from assets/openai-audio-transcription-IjkiOEt-.js rename to assets/openai-audio-transcription-CWLk8_6R.js index 2a84e4bbce49736eebb900cf37e6ff79d6ea61ab..d81b6f345963f570ac39b0ee6a824de2f424df54 100644 --- a/assets/openai-audio-transcription-IjkiOEt-.js +++ b/assets/openai-audio-transcription-CWLk8_6R.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`openai`;var x=r({__name:`openai-audio-transcription`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||`https://api.openai.com/v1/`},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||`https://api.openai.com/v1/`}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName||`OpenAI`,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`openai`;var x=r({__name:`openai-audio-transcription`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||`https://api.openai.com/v1/`},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||`https://api.openai.com/v1/`}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName||`OpenAI`,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/openrouter-ai-mKjCEqCW.js b/assets/openrouter-ai-DJ3Pwf8-.js similarity index 84% rename from assets/openrouter-ai-mKjCEqCW.js rename to assets/openrouter-ai-DJ3Pwf8-.js index f486c59d8fc69eb416a7ae1188c104648f93355f..4d9cc0d28616de5f7ef2c03521da1ba048de7350 100644 --- a/assets/openrouter-ai-mKjCEqCW.js +++ b/assets/openrouter-ai-DJ3Pwf8-.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`openrouter-ai`;var x=r({__name:`openrouter-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e,t,n;return(e=C.value[b])?.baseUrl||((t=w.value)==null||(n=t.defaultOptions)==null?void 0:n.call(t).baseUrl)||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t,n,r;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||((n=w.value)==null||(r=n.defaultOptions)==null?void 0:r.call(n).baseUrl)||``}),u([T,E],()=>{var e,t;C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||((e=w.value)==null||(t=e.defaultOptions)==null?void 0:t.call(e).baseUrl)||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`sk-or-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>{var e,t;return[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:((e=w.value)==null||(t=e.defaultOptions)==null?void 0:t.call(e).baseUrl)||``},null,8,[`modelValue`,`placeholder`])]}),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`openrouter-ai`;var x=r({__name:`openrouter-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e,t,n;return(e=C.value[b])?.baseUrl||((t=w.value)==null||(n=t.defaultOptions)==null?void 0:n.call(t).baseUrl)||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t,n,r;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||((n=w.value)==null||(r=n.defaultOptions)==null?void 0:r.call(n).baseUrl)||``}),u([T,E],()=>{var e,t;C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||((e=w.value)==null||(t=e.defaultOptions)==null?void 0:t.call(e).baseUrl)||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`sk-or-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>{var e,t;return[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:((e=w.value)==null||(t=e.defaultOptions)==null?void 0:t.call(e).baseUrl)||``},null,8,[`modelValue`,`placeholder`])]}),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/pages-BuUyaRGx.js b/assets/pages-DN0dVd_t.js similarity index 94% rename from assets/pages-BuUyaRGx.js rename to assets/pages-DN0dVd_t.js index d26b21f06d2d9e2a2283c60ad8f157d9fdeb50d0..7f5ee7796574b0fdadc75e82bc3fbb05384f42c2 100644 --- a/assets/pages-BuUyaRGx.js +++ b/assets/pages-DN0dVd_t.js @@ -1 +1 @@ -import{__plugin_vue_export_helper_default as e,createBaseVNode as t,createElementBlock as n,openBlock as r}from"./index-BSwg6FIo.js";import{route_block_default as i}from"./route-block-CC3cgg4Q.js";const a={},o={"mx-10":``,"h-full":``,"w-full":``,flex:``,"items-center":``};function s(e,i){return r(),n(`div`,o,i[0]||=[t(`div`,{class:`title-wrapper`,w:`40%`},[t(`div`,{class:`title-container`},[t(`div`,{bg:`primary-300 dark:primary-700`,"mb-12":``,"rounded-xl":``,"py-4":``,"pl-5":``,"pr-8":``,"text-nowrap":``,"text-5xl":``,"text-white":``,"font-semibold":``,"font-quicksand":``},` Project AIRI `),t(`div`,{flex:``,"flex-col":``,"gap-3":``},[t(`div`,{"rounded-full":``,"px-5":``,"py-4":``,border:`3 solid primary-300 dark:primary-700`,bg:`primary-300/50 dark:primary-700/50`,"text-2xl":``},[t(`div`,null,`Start`)]),t(`div`,{"rounded-full":``,"px-5":``,"py-4":``,border:`3 solid primary-300 dark:primary-700`,bg:`primary-300/50 dark:primary-700/50`,"text-2xl":``},[t(`div`,null,`Settings`)]),t(`div`,{"rounded-full":``,"px-5":``,"py-4":``,border:`3 solid primary-300 dark:primary-700`,bg:`primary-300/50 dark:primary-700/50`,"text-2xl":``},[t(`div`,null,`About`)])])])],-1)])}typeof i==`function`&&i(a);var c=e(a,[[`render`,s]]);export{c as default}; \ No newline at end of file +import{__plugin_vue_export_helper_default as e,createBaseVNode as t,createElementBlock as n,openBlock as r}from"./index-DKziOBM4.js";import{route_block_default as i}from"./route-block-CC3cgg4Q.js";const a={},o={"mx-10":``,"h-full":``,"w-full":``,flex:``,"items-center":``};function s(e,i){return r(),n(`div`,o,i[0]||=[t(`div`,{class:`title-wrapper`,w:`40%`},[t(`div`,{class:`title-container`},[t(`div`,{bg:`primary-300 dark:primary-700`,"mb-12":``,"rounded-xl":``,"py-4":``,"pl-5":``,"pr-8":``,"text-nowrap":``,"text-5xl":``,"text-white":``,"font-semibold":``,"font-quicksand":``},` Project AIRI `),t(`div`,{flex:``,"flex-col":``,"gap-3":``},[t(`div`,{"rounded-full":``,"px-5":``,"py-4":``,border:`3 solid primary-300 dark:primary-700`,bg:`primary-300/50 dark:primary-700/50`,"text-2xl":``},[t(`div`,null,`Start`)]),t(`div`,{"rounded-full":``,"px-5":``,"py-4":``,border:`3 solid primary-300 dark:primary-700`,bg:`primary-300/50 dark:primary-700/50`,"text-2xl":``},[t(`div`,null,`Settings`)]),t(`div`,{"rounded-full":``,"px-5":``,"py-4":``,border:`3 solid primary-300 dark:primary-700`,bg:`primary-300/50 dark:primary-700/50`,"text-2xl":``},[t(`div`,null,`About`)])])])],-1)])}typeof i==`function`&&i(a);var c=e(a,[[`render`,s]]);export{c as default}; \ No newline at end of file diff --git a/assets/player2-api-DYzC8-m3.js b/assets/player2-api-B_cW5fsP.js similarity index 75% rename from assets/player2-api-DYzC8-m3.js rename to assets/player2-api-B_cW5fsP.js index e42971830f2eb26eeac1ff626cff7664aeaa953b..39138df70ae4ab8923a6780d231166bcf4e266cd 100644 --- a/assets/player2-api-DYzC8-m3.js +++ b/assets/player2-api-B_cW5fsP.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,resolveComponent as o,storeToRefs as s,unref as c,useI18n as l,useRouter as u,watch as d,withCtx as f}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderBaseUrlInput_default as m,ProviderSettingsContainer_default as h,ProviderSettingsLayout_default as g}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as _}from"./route-block-CC3cgg4Q.js";const v=`player2-api`;var y=r({__name:`player2-api`,setup(r){let{t:_}=l(),y=u(),b=p(),{providers:x}=s(b),S=e(()=>b.getProviderMetadata(v)),C=e({get:()=>{var e;return(e=x.value[v])?.baseUrl||``},set:e=>{x.value[v]||(x.value[v]={}),x.value[v].baseUrl=e}});i(()=>{var e;b.initializeProvider(v),C.value=(e=x.value[v])?.baseUrl||``}),d([C],()=>{x.value[v]={...x.value[v],baseUrl:C.value||``}});function w(){var e;x.value[v]={...(e=S.value)?.defaultOptions}}return(e,r)=>{var i,s;let l=o(`ProviderBasicSettings`);return a(),t(c(g),{"provider-name":(i=S.value)?.localizedName,"provider-icon":(s=S.value)?.icon,"on-back":()=>c(y).back()},{default:f(()=>[n(c(h),null,{default:f(()=>[n(l,{title:c(_)(`settings.pages.providers.common.section.basic.title`),description:c(_)(`settings.pages.providers.common.section.basic.description`),"on-reset":w},{default:f(()=>[n(c(m),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,placeholder:`http://localhost:4315/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof _==`function`&&_(y);var b=y;export{b as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,resolveComponent as o,storeToRefs as s,unref as c,useI18n as l,useRouter as u,watch as d,withCtx as f}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderBaseUrlInput_default as m,ProviderSettingsContainer_default as h,ProviderSettingsLayout_default as g}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as _}from"./route-block-CC3cgg4Q.js";const v=`player2-api`;var y=r({__name:`player2-api`,setup(r){let{t:_}=l(),y=u(),b=p(),{providers:x}=s(b),S=e(()=>b.getProviderMetadata(v)),C=e({get:()=>{var e;return(e=x.value[v])?.baseUrl||``},set:e=>{x.value[v]||(x.value[v]={}),x.value[v].baseUrl=e}});i(()=>{var e;b.initializeProvider(v),C.value=(e=x.value[v])?.baseUrl||``}),d([C],()=>{x.value[v]={...x.value[v],baseUrl:C.value||``}});function w(){var e;x.value[v]={...(e=S.value)?.defaultOptions}}return(e,r)=>{var i,s;let l=o(`ProviderBasicSettings`);return a(),t(c(g),{"provider-name":(i=S.value)?.localizedName,"provider-icon":(s=S.value)?.icon,"on-back":()=>c(y).back()},{default:f(()=>[n(c(h),null,{default:f(()=>[n(l,{title:c(_)(`settings.pages.providers.common.section.basic.title`),description:c(_)(`settings.pages.providers.common.section.basic.description`),"on-reset":w},{default:f(()=>[n(c(m),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,placeholder:`http://localhost:4315/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof _==`function`&&_(y);var b=y;export{b as default}; \ No newline at end of file diff --git a/assets/polaroid-DbFi6Mzo.js b/assets/polaroid-BoXbUjSB.js similarity index 76% rename from assets/polaroid-DbFi6Mzo.js rename to assets/polaroid-BoXbUjSB.js index a1a35c6fb593b91245e65981e23ee116f4c677fa..bd27f828c8fe49b5326227eb0fbf35cf18130d94 100644 --- a/assets/polaroid-DbFi6Mzo.js +++ b/assets/polaroid-BoXbUjSB.js @@ -1 +1 @@ -import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,ref as o,renderList as s,toDisplayString as c,unref as l,vModelSelect as u,watch as d,withCtx as f,withDirectives as p}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{Canvas_default as m,Model_default as h,Screen_default as g}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";const _={flex:``,"flex-col":``,"items-center":``,"gap-4":``},v={"h-full":``,"w-full":``},y=[`value`];var b=i({__name:`polaroid`,setup(i){let b=o(),x=o(),S=o(`idle`),C=o([]);function w(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function T(e){var t;(t=x.value)?.setMotion(e)}d(x,e=>{C.value=e?.listMotionGroups()||[]},{immediate:!0});function E(){x.value&&(x.value.setMotion(S.value),C.value=x.value.listMotionGroups())}function D(){if(!b.value||!x.value)return;let e=b.value.canvasElement(),t=e.toDataURL(`image/png`);w(t,`live2d-screenshot.png`)}return(i,o)=>(a(),n(`div`,_,[t(`div`,v,[r(l(g),{relative:``,"min-h-70dvh":``},{default:f(({width:e,height:t})=>[r(l(m),{ref_key:`live2dCanvasRef`,ref:b,width:e,height:t,resolution:3,"rounded-full":``},{default:f(({app:n})=>[r(l(h),{ref_key:`live2dModelRef`,ref:x,app:n,width:e,height:t,"focus-at":{x:e/2,y:t/2},onModelLoaded:E},null,8,[`app`,`width`,`height`,`focus-at`])]),_:2},1032,[`width`,`height`])]),_:1})]),t(`div`,null,[p(t(`select`,{"onUpdate:modelValue":o[0]||=e=>S.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:o[1]||=e=>T(S.value)},[(a(!0),n(e,null,s(C.value,e=>(a(),n(`option`,{key:e.motionIndex,value:e.motionName},c(e.fileName),9,y))),128))],544),[[u,S.value]])]),t(`div`,{border:`2px solid white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[t(`button`,{"h-18":``,"w-18":``,"rounded-full":``,bg:`white active:gray-50`,"outline-none":``,"transition-colors":``,"duration-200":``,"ease-in-out":``,onClick:D})])]))}}),x=b;export{x as default}; \ No newline at end of file +import{Fragment as e,createBaseVNode as t,createElementBlock as n,createVNode as r,defineComponent as i,openBlock as a,ref as o,renderList as s,toDisplayString as c,unref as l,vModelSelect as u,watch as d,withCtx as f,withDirectives as p}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{Canvas_default as m,Model_default as h,Screen_default as g}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";const _={flex:``,"flex-col":``,"items-center":``,"gap-4":``},v={"h-full":``,"w-full":``},y=[`value`];var b=i({__name:`polaroid`,setup(i){let b=o(),x=o(),S=o(`idle`),C=o([]);function w(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function T(e){var t;(t=x.value)?.setMotion(e)}d(x,e=>{C.value=e?.listMotionGroups()||[]},{immediate:!0});function E(){x.value&&(x.value.setMotion(S.value),C.value=x.value.listMotionGroups())}function D(){if(!b.value||!x.value)return;let e=b.value.canvasElement(),t=e.toDataURL(`image/png`);w(t,`live2d-screenshot.png`)}return(i,o)=>(a(),n(`div`,_,[t(`div`,v,[r(l(g),{relative:``,"min-h-70dvh":``},{default:f(({width:e,height:t})=>[r(l(m),{ref_key:`live2dCanvasRef`,ref:b,width:e,height:t,resolution:3,"rounded-full":``},{default:f(({app:n})=>[r(l(h),{ref_key:`live2dModelRef`,ref:x,app:n,width:e,height:t,"focus-at":{x:e/2,y:t/2},onModelLoaded:E},null,8,[`app`,`width`,`height`,`focus-at`])]),_:2},1032,[`width`,`height`])]),_:1})]),t(`div`,null,[p(t(`select`,{"onUpdate:modelValue":o[0]||=e=>S.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:o[1]||=e=>T(S.value)},[(a(!0),n(e,null,s(C.value,e=>(a(),n(`option`,{key:e.motionIndex,value:e.motionName},c(e.fileName),9,y))),128))],544),[[u,S.value]])]),t(`div`,{border:`2px solid white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[t(`button`,{"h-18":``,"w-18":``,"rounded-full":``,bg:`white active:gray-50`,"outline-none":``,"transition-colors":``,"duration-200":``,"ease-in-out":``,onClick:D})])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/providers-B-S3_fuC.js b/assets/providers-CMOdvsid.js similarity index 88% rename from assets/providers-B-S3_fuC.js rename to assets/providers-CMOdvsid.js index 914b5825600161099dcb76a199b83e79a1385937..3c40605ce793a2f458b49d6141cf87ccb5a9b246 100644 --- a/assets/providers-B-S3_fuC.js +++ b/assets/providers-CMOdvsid.js @@ -1 +1 @@ -import{Fragment as e,createBaseVNode as t,createBlock as n,createElementBlock as r,createTextVNode as i,defineComponent as a,openBlock as o,renderList as s,resolveDirective as c,storeToRefs as l,unref as u,withDirectives as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{IconStatusItem_default as p}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as m}from"./route-block-CC3cgg4Q.js";import{IconAnimation_default as h}from"./IconAnimation-LJjhLEIS.js";import{useIconAnimation as g}from"./useIconAnimation-DBzeTvDN.js";const _={flex:``,"flex-col":``,"gap-5":``},v={grid:`~ cols-2 gap-4`},y={grid:`~ cols-2 gap-4`},b={grid:`~ cols-2 gap-4`},x={key:1,text:`neutral-500/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var S=a({__name:`index`,setup(a){let m=f(),{allChatProvidersMetadata:S,allAudioSpeechProvidersMetadata:C,allAudioTranscriptionProvidersMetadata:w}=l(m),{iconAnimationStarted:T,showIconAnimation:E,animationIcon:D}=g(`i-solar:box-minimalistic-bold-duotone`);return(a,l)=>{let f=c(`motion`);return o(),r(e,null,[t(`div`,_,[l[0]||=t(`div`,{bg:`primary-500/10 dark:primary-800/25`,"rounded-lg":``,"p-4":``},[t(`div`,{"mb-2":``,"text-xl":``,"font-semibold":``,text:`primary-800 dark:primary-100`},` First time here? `),t(`div`,{text:`primary-700 dark:primary-300`},[i(` AIRI requires at least one `),t(`div`,{bg:`primary-500/10 dark:primary-800/25`,"inline-flex":``,"items-center":``,"gap-1":``,"rounded-lg":``,"px-2":``,"py-0.5":``,"translate-y":`[0.25lh]`},[t(`div`,{"i-solar:chat-square-like-bold-duotone":``}),t(`strong`,{"font-semibold":``},`Chat`)]),i(` provider to be configured to think, and behave properly. You could think of it as the brain of the characters living in AIRI system. `)])],-1),l[1]||=t(`div`,{flex:`~ row items-center gap-2`},[t(`div`,{"i-solar:chat-square-like-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`}),t(`div`,null,[t(`div`,null,[t(`span`,{text:`neutral-300 dark:neutral-500`},`Text generation model providers. e.g. OpenRouter, OpenAI, Ollama.`)]),t(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-semibold":``},[t(`div`,null,` Chat `)])])],-1),t(`div`,v,[(o(!0),r(e,null,s(u(S),(e,t)=>d((o(),n(u(p),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[f]])),128))]),l[2]||=t(`div`,{flex:`~ row items-center gap-2`,"my-5":``},[t(`div`,{"i-solar:user-speak-rounded-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`}),t(`div`,null,[t(`div`,null,[t(`span`,{text:`neutral-300 dark:neutral-500`},`Speech (text-to-speech) model providers. e.g. ElevenLabs, Azure Speech.`)]),t(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-semibold":``},[t(`div`,null,` Speech `)])])],-1),t(`div`,y,[(o(!0),r(e,null,s(u(C),(e,t)=>d((o(),n(u(p),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(u(S).length+t)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[f]])),128))]),l[3]||=t(`div`,{flex:`~ row items-center gap-2`,"my-5":``},[t(`div`,{"i-solar:microphone-3-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`}),t(`div`,null,[t(`div`,null,[t(`span`,{text:`neutral-300 dark:neutral-500`},`Transcription (speech-to-text) model providers. e.g. Whisper.cpp, OpenAI, Azure Speech`)]),t(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-semibold":``},[t(`div`,null,` Transcription `)])])],-1),t(`div`,b,[(o(!0),r(e,null,s(u(w),(e,t)=>d((o(),n(u(p),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(u(S).length+u(C).length+t)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[f]])),128))])]),u(E)?(o(),n(h,{key:0,"z-index":-1,icon:u(D),"icon-size":12,duration:1e3,started:u(T),"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`])):d((o(),r(`div`,x,l[4]||=[t(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)])),[[f]])],64)}}});typeof m==`function`&&m(S);var C=S;export{C as default}; \ No newline at end of file +import{Fragment as e,createBaseVNode as t,createBlock as n,createElementBlock as r,createTextVNode as i,defineComponent as a,openBlock as o,renderList as s,resolveDirective as c,storeToRefs as l,unref as u,withDirectives as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{IconStatusItem_default as p}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as m}from"./route-block-CC3cgg4Q.js";import{IconAnimation_default as h}from"./IconAnimation-D-xhKJXy.js";import{useIconAnimation as g}from"./useIconAnimation-DZK17st3.js";const _={flex:``,"flex-col":``,"gap-5":``},v={grid:`~ cols-2 gap-4`},y={grid:`~ cols-2 gap-4`},b={grid:`~ cols-2 gap-4`},x={key:1,text:`neutral-500/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var S=a({__name:`index`,setup(a){let m=f(),{allChatProvidersMetadata:S,allAudioSpeechProvidersMetadata:C,allAudioTranscriptionProvidersMetadata:w}=l(m),{iconAnimationStarted:T,showIconAnimation:E,animationIcon:D}=g(`i-solar:box-minimalistic-bold-duotone`);return(a,l)=>{let f=c(`motion`);return o(),r(e,null,[t(`div`,_,[l[0]||=t(`div`,{bg:`primary-500/10 dark:primary-800/25`,"rounded-lg":``,"p-4":``},[t(`div`,{"mb-2":``,"text-xl":``,"font-semibold":``,text:`primary-800 dark:primary-100`},` First time here? `),t(`div`,{text:`primary-700 dark:primary-300`},[i(` AIRI requires at least one `),t(`div`,{bg:`primary-500/10 dark:primary-800/25`,"inline-flex":``,"items-center":``,"gap-1":``,"rounded-lg":``,"px-2":``,"py-0.5":``,"translate-y":`[0.25lh]`},[t(`div`,{"i-solar:chat-square-like-bold-duotone":``}),t(`strong`,{"font-semibold":``},`Chat`)]),i(` provider to be configured to think, and behave properly. You could think of it as the brain of the characters living in AIRI system. `)])],-1),l[1]||=t(`div`,{flex:`~ row items-center gap-2`},[t(`div`,{"i-solar:chat-square-like-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`}),t(`div`,null,[t(`div`,null,[t(`span`,{text:`neutral-300 dark:neutral-500`},`Text generation model providers. e.g. OpenRouter, OpenAI, Ollama.`)]),t(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-semibold":``},[t(`div`,null,` Chat `)])])],-1),t(`div`,v,[(o(!0),r(e,null,s(u(S),(e,t)=>d((o(),n(u(p),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[f]])),128))]),l[2]||=t(`div`,{flex:`~ row items-center gap-2`,"my-5":``},[t(`div`,{"i-solar:user-speak-rounded-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`}),t(`div`,null,[t(`div`,null,[t(`span`,{text:`neutral-300 dark:neutral-500`},`Speech (text-to-speech) model providers. e.g. ElevenLabs, Azure Speech.`)]),t(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-semibold":``},[t(`div`,null,` Speech `)])])],-1),t(`div`,y,[(o(!0),r(e,null,s(u(C),(e,t)=>d((o(),n(u(p),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(u(S).length+t)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[f]])),128))]),l[3]||=t(`div`,{flex:`~ row items-center gap-2`,"my-5":``},[t(`div`,{"i-solar:microphone-3-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`}),t(`div`,null,[t(`div`,null,[t(`span`,{text:`neutral-300 dark:neutral-500`},`Transcription (speech-to-text) model providers. e.g. Whisper.cpp, OpenAI, Azure Speech`)]),t(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-semibold":``},[t(`div`,null,` Transcription `)])])],-1),t(`div`,b,[(o(!0),r(e,null,s(u(w),(e,t)=>d((o(),n(u(p),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(u(S).length+u(C).length+t)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[f]])),128))])]),u(E)?(o(),n(h,{key:0,"z-index":-1,icon:u(D),"icon-size":12,duration:1e3,started:u(T),"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`])):d((o(),r(`div`,x,l[4]||=[t(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)])),[[f]])],64)}}});typeof m==`function`&&m(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/queue-Cw0r8hJ-.js b/assets/queue-D6mkPVC_.js similarity index 92% rename from assets/queue-Cw0r8hJ-.js rename to assets/queue-D6mkPVC_.js index c4649770783c3b2183b92f44086a074cdf10faa4..583942b3e7ea2611b2ceba874f232be12df7b148 100644 --- a/assets/queue-Cw0r8hJ-.js +++ b/assets/queue-D6mkPVC_.js @@ -1 +1 @@ -import{ref as e}from"./index-BSwg6FIo.js";function t(t){let n=e([]),r=e(!1),i={add:[],pick:[],processing:[],error:[],processed:[],done:[]},a={};function o(e,t){i[e].push(t)}function s(e,...t){let n=i[e];n.forEach(e=>{e(...t)})}function c(e,t){a[e]=a[e]||[],a[e].push(t)}function l(e,...t){let n=a[e]||[];n.forEach(e=>{e(...t)})}async function u(e){n.value.push(e),s(`add`,e)}function d(){let e=n.value.shift();if(e)return s(`pick`,e),e}async function f(){if(r.value)return;let e=d();if(e){r.value=!0;for(let r of t.handlers){s(`processing`,e,r);try{let t=await r({data:e,itemsToBeProcessed:()=>n.value.length,emit:l});s(`processed`,e,t,r)}catch(t){s(`error`,e,t,r);continue}}r.value=!1,s(`done`,e),n.value.length>0&&f()}}return o(`add`,f),o(`done`,f),{add:u,on:o,onHandlerEvent:c,queue:n}}export{t as useQueue}; \ No newline at end of file +import{ref as e}from"./index-DKziOBM4.js";function t(t){let n=e([]),r=e(!1),i={add:[],pick:[],processing:[],error:[],processed:[],done:[]},a={};function o(e,t){i[e].push(t)}function s(e,...t){let n=i[e];n.forEach(e=>{e(...t)})}function c(e,t){a[e]=a[e]||[],a[e].push(t)}function l(e,...t){let n=a[e]||[];n.forEach(e=>{e(...t)})}async function u(e){n.value.push(e),s(`add`,e)}function d(){let e=n.value.shift();if(e)return s(`pick`,e),e}async function f(){if(r.value)return;let e=d();if(e){r.value=!0;for(let r of t.handlers){s(`processing`,e,r);try{let t=await r({data:e,itemsToBeProcessed:()=>n.value.length,emit:l});s(`processed`,e,t,r)}catch(t){s(`error`,e,t,r);continue}}r.value=!1,s(`done`,e),n.value.length>0&&f()}}return o(`add`,f),o(`done`,f),{add:u,on:o,onHandlerEvent:c,queue:n}}export{t as useQueue}; \ No newline at end of file diff --git a/assets/queue-NqCetSQS.js b/assets/queue-DeMWSQ3F.js similarity index 65% rename from assets/queue-NqCetSQS.js rename to assets/queue-DeMWSQ3F.js index 7fc2707dcf2713ede3b7f5ef3d70b303a5439f4a..9913e14c6bb1373490940f3b27797c187671e3d5 100644 --- a/assets/queue-NqCetSQS.js +++ b/assets/queue-DeMWSQ3F.js @@ -1 +1 @@ -import{createBaseVNode as e,createElementBlock as t,defineComponent as n,onMounted as r,openBlock as i,ref as a}from"./index-BSwg6FIo.js";import{useQueue as o}from"./queue-Cw0r8hJ-.js";import{sleep as s}from"./sleep-CvjNLutj.js";var c=n({__name:`queue`,setup(n){let c=a(``),l=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),l.add(e.data)}]}),d=o({handlers:[async e=>{let t=[`.`,`?`,`!`],n=!1;for(let r of t){if(!e.data.includes(r))continue;let t=e.data.indexOf(r),i=e.data.slice(0,t+1),a=e.data.slice(t+1);c.value+=i,u.add(c.value.trim()),c.value=a,n=!0}n||(c.value+=e.data)}]}),f=`Hello( N(eko(! I( am( an( AI( assistant( trained( to( help( with( a( variety( of( tasks( such( as( answering( questions(,( providing( information(,( giving( recommendations(,( and( more(. How( can( I( assist( you( today(?(Hello( N(eko(,( I( am( an( AI( assistant(.( I( can( help( answer( questions(,( provide( information(,( assist( with( tasks(,( and( engage( in( conversation(.( How( can( I( assist( you( today(?`.split(`(`);async function p(){for(let e of f)await s(100),d.add(e)}async function m(){p()}return r(()=>{m()}),(n,r)=>(i(),t(`div`,null,r[0]||=[e(`div`,null,null,-1)]))}}),l=c;export{l as default}; \ No newline at end of file +import{createBaseVNode as e,createElementBlock as t,defineComponent as n,onMounted as r,openBlock as i,ref as a}from"./index-DKziOBM4.js";import{sleep as o}from"./sleep-JdatAils.js";import{useQueue as s}from"./queue-D6mkPVC_.js";var c=n({__name:`queue`,setup(n){let c=a(``),l=s({handlers:[async e=>{console.log(`ready to play speech audio for`,e)}]}),u=s({handlers:[async e=>{console.log(`ready to stream speech audio for`,e),l.add(e.data)}]}),d=s({handlers:[async e=>{let t=[`.`,`?`,`!`],n=!1;for(let r of t){if(!e.data.includes(r))continue;let t=e.data.indexOf(r),i=e.data.slice(0,t+1),a=e.data.slice(t+1);c.value+=i,u.add(c.value.trim()),c.value=a,n=!0}n||(c.value+=e.data)}]}),f=`Hello( N(eko(! I( am( an( AI( assistant( trained( to( help( with( a( variety( of( tasks( such( as( answering( questions(,( providing( information(,( giving( recommendations(,( and( more(. How( can( I( assist( you( today(?(Hello( N(eko(,( I( am( an( AI( assistant(.( I( can( help( answer( questions(,( provide( information(,( assist( with( tasks(,( and( engage( in( conversation(.( How( can( I( assist( you( today(?`.split(`(`);async function p(){for(let e of f)await o(100),d.add(e)}async function m(){p()}return r(()=>{m()}),(n,r)=>(i(),t(`div`,null,r[0]||=[e(`div`,null,null,-1)]))}}),l=c;export{l as default}; \ No newline at end of file diff --git a/assets/queues-XZuprNy-.js b/assets/queues-BZSFjE0u.js similarity index 63% rename from assets/queues-XZuprNy-.js rename to assets/queues-BZSFjE0u.js index be4c373354132f632c1bee7aeee7e1d1eb0f7b31..c3940b186c9fdd30e7d53da8308b7b8b57c145f5 100644 --- a/assets/queues-XZuprNy-.js +++ b/assets/queues-BZSFjE0u.js @@ -1,4 +1,4 @@ -import{ref as e}from"./index-BSwg6FIo.js";import{useQueue as t}from"./queue-Cw0r8hJ-.js";import{sleep as n}from"./sleep-CvjNLutj.js";let r=function(e){return 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}({});const i=Object.values(r),a=`Happy`,o=`Sad`,s=`Angry`,c=`Awkward`,l=`Think`,u=`Surprise`,d=`Question`,f=`Idle`,p={[r.Happy]:a,[r.Sad]:o,[r.Angry]:s,[r.Think]:l,[r.Surprise]:u,[r.Awkward]:c,[r.Question]:d,[r.Idle]:f},m={[r.Happy]:`happy`,[r.Sad]:`sad`,[r.Angry]:`angry`,[r.Think]:void 0,[r.Surprise]:`surprised`,[r.Awkward]:void 0,[r.Question]:void 0,[r.Idle]:void 0};function h(e,t){return{role:`system`,content:[e,i.map(e=>`- ${e}`).join(` +import{ref as e}from"./index-DKziOBM4.js";import{sleep as t}from"./sleep-JdatAils.js";import{useQueue as n}from"./queue-D6mkPVC_.js";let r=function(e){return 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}({});const i=Object.values(r),a=`Happy`,o=`Sad`,s=`Angry`,c=`Awkward`,l=`Think`,u=`Surprise`,d=`Question`,f=`Idle`,p={[r.Happy]:a,[r.Sad]:o,[r.Angry]:s,[r.Think]:l,[r.Surprise]:u,[r.Awkward]:c,[r.Question]:d,[r.Idle]:f},m={[r.Happy]:`happy`,[r.Sad]:`sad`,[r.Angry]:`angry`,[r.Think]:void 0,[r.Surprise]:`surprised`,[r.Awkward]:void 0,[r.Question]:void 0,[r.Idle]:void 0};function h(e,t){return{role:`system`,content:[e,i.map(e=>`- ${e}`).join(` `),t].join(` -`)}}var g=h;const _=`<|llm_inference_end|>`;function v(e){function n(e){for(let t of i){if(!e.includes(t))continue;return{ok:!0,emotion:t}}return{ok:!1,emotion:``}}return t({handlers:[async t=>{if(i.includes(t.data)){t.emit(`emotion`,t.data),await e.add(t.data);return}{let{ok:r,emotion:i}=n(t.data);r&&(t.emit(`emotion`,i),await e.add(i))}}]})}function y(){function e(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};let t=/<\|DELAY:(\d+)\|>/i.exec(e),n=t?.[1];if(!n)return{ok:!1,delay:0};let r=Number.parseFloat(n);return r<=0||Number.isNaN(r)?{ok:!0,delay:0}:{ok:!0,delay:r}}return t({handlers:[async t=>{let{ok:r,delay:i}=e(t.data);r&&(t.emit(`delay`,i),await n(i*1e3))}]})}function b(n){let r=e(``);return t({handlers:[async e=>{if(e.data===_){let e=r.value.trim();e&&await n.add(e),r.value=``;return}let t=/[.?!]/;for(r.value+=e.data;r.value;){let e=t.exec(r.value);if(!e||e.index===void 0)break;let i=r.value.slice(0,e.index+1),a=r.value.slice(e.index+1);await n.add(i),r.value=a}}]})}export{p as EMOTION_EmotionMotionName_value,m as EMOTION_VRMExpressionName_value,r as Emotion,f as EmotionNeutralMotionName,l as EmotionThinkMotionName,_ as llmInferenceEndToken,g as system_v2_default,y as useDelayMessageQueue,v as useEmotionsMessageQueue,b as useMessageContentQueue}; \ No newline at end of file +`)}}var g=h;const _=`<|llm_inference_end|>`;function v(e){function t(e){for(let t of i){if(!e.includes(t))continue;return{ok:!0,emotion:t}}return{ok:!1,emotion:``}}return n({handlers:[async n=>{if(i.includes(n.data)){n.emit(`emotion`,n.data),await e.add(n.data);return}{let{ok:r,emotion:i}=t(n.data);r&&(n.emit(`emotion`,i),await e.add(i))}}]})}function y(){function e(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};let t=/<\|DELAY:(\d+)\|>/i.exec(e),n=t?.[1];if(!n)return{ok:!1,delay:0};let r=Number.parseFloat(n);return r<=0||Number.isNaN(r)?{ok:!0,delay:0}:{ok:!0,delay:r}}return n({handlers:[async n=>{let{ok:r,delay:i}=e(n.data);r&&(n.emit(`delay`,i),await t(i*1e3))}]})}function b(t){let r=e(``);return n({handlers:[async e=>{if(e.data===_){let e=r.value.trim();e&&await t.add(e),r.value=``;return}let n=/[.?!]/;for(r.value+=e.data;r.value;){let e=n.exec(r.value);if(!e||e.index===void 0)break;let i=r.value.slice(0,e.index+1),a=r.value.slice(e.index+1);await t.add(i),r.value=a}}]})}export{p as EMOTION_EmotionMotionName_value,m as EMOTION_VRMExpressionName_value,r as Emotion,f as EmotionNeutralMotionName,l as EmotionThinkMotionName,_ as llmInferenceEndToken,g as system_v2_default,y as useDelayMessageQueue,v as useEmotionsMessageQueue,b as useMessageContentQueue}; \ No newline at end of file diff --git a/assets/scene-sC31UkJB.js b/assets/scene-DrliOSzk.js similarity index 64% rename from assets/scene-sC31UkJB.js rename to assets/scene-DrliOSzk.js index fcd769908655dbb22b2668ffd9446336fbc15c8b..2406741949edd7a238c98b52fcb9c6ba0aead947 100644 --- a/assets/scene-sC31UkJB.js +++ b/assets/scene-DrliOSzk.js @@ -1 +1 @@ -import{Fragment as e,createBaseVNode as t,createBlock as n,createElementBlock as r,defineComponent as i,openBlock as a,resolveDirective as o,unref as s,withDirectives as c}from"./index-BSwg6FIo.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as l}from"./route-block-CC3cgg4Q.js";import{IconAnimation_default as u}from"./IconAnimation-LJjhLEIS.js";import{useIconAnimation as d}from"./useIconAnimation-DBzeTvDN.js";const f={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var p=i({__name:`index`,setup(i){let{iconAnimationStarted:l,showIconAnimation:p,animationIcon:m}=d(`i-solar:armchair-2-bold-duotone`);return(i,d)=>{let h=o(`motion`);return a(),r(e,null,[d[1]||=t(`div`,null,` Scene `,-1),s(p)?(a(),n(u,{key:0,"z-index":-1,icon:s(m),"icon-size":12,duration:1e3,started:s(l),"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`])):c((a(),r(`div`,f,d[0]||=[t(`div`,{text:`60`,"i-solar:armchair-2-bold-duotone":``},null,-1)])),[[h]])],64)}}});typeof l==`function`&&l(p);var m=p;export{m as default}; \ No newline at end of file +import{Fragment as e,createBaseVNode as t,createBlock as n,createElementBlock as r,defineComponent as i,openBlock as a,resolveDirective as o,unref as s,withDirectives as c}from"./index-DKziOBM4.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as l}from"./route-block-CC3cgg4Q.js";import{IconAnimation_default as u}from"./IconAnimation-D-xhKJXy.js";import{useIconAnimation as d}from"./useIconAnimation-DZK17st3.js";const f={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var p=i({__name:`index`,setup(i){let{iconAnimationStarted:l,showIconAnimation:p,animationIcon:m}=d(`i-solar:armchair-2-bold-duotone`);return(i,d)=>{let h=o(`motion`);return a(),r(e,null,[d[1]||=t(`div`,null,` Scene `,-1),s(p)?(a(),n(u,{key:0,"z-index":-1,icon:s(m),"icon-size":12,duration:1e3,started:s(l),"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`])):c((a(),r(`div`,f,d[0]||=[t(`div`,{text:`60`,"i-solar:armchair-2-bold-duotone":``},null,-1)])),[[h]])],64)}}});typeof l==`function`&&l(p);var m=p;export{m as default}; \ No newline at end of file diff --git a/assets/settings-_CwCCEeu.js b/assets/settings-D1j-vsv3.js similarity index 97% rename from assets/settings-_CwCCEeu.js rename to assets/settings-D1j-vsv3.js index da631e408b2304c3e0f7480b8858366fb6232136..d8485be9b241026a9c64cee6054f14d166aec2fb 100644 --- a/assets/settings-_CwCCEeu.js +++ b/assets/settings-D1j-vsv3.js @@ -1 +1 @@ -var e=function(exports){function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}return exports.defineProperty=i,exports}({});import{Fragment as t,RouterView as n,alpha as r,animate as i,anticipate as a,backIn as o,backInOut as s,backOut as c,bounceIn as l,bounceInOut as u,bounceOut as ee,circIn as te,circInOut as ne,circOut as re,color as d,complex as ie,computed as f,createBaseVNode as p,createCommentVNode as m,createElementBlock as h,createVNode as g,cubicBezier as ae,defineComponent as _,defu as oe,degrees as v,easeIn as se,easeInOut as ce,easeOut as le,es_default as ue,filter as y,getFrameData as de,h as b,inertia as fe,inject as pe,isObject as me,linear as he,nextTick as ge,normalizeClass as _e,number as ve,onMounted as ye,onUnmounted as be,openBlock as x,progressPercentage as S,px as C,reactive as w,ref as T,scale as E,storeToRefs as xe,toDisplayString as D,toRaw as Se,tryOnUnmounted as Ce,unref as O,unrefElement as we,useEventListener as k,useI18n as Te,useIntersectionObserver as Ee,useRoute as A,useRouter as De,useSlots as j,velocityPerSecond as Oe,watch as M}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as ke}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import{HeaderLink_default as Ae}from"./HeaderLink-rfbghXs_.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";const N={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_TARGET_HUGGINGFACE_SPACE:`true`};var je=class{constructor(){e.defineProperty(this,`subscriptions`,new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,n){if(this.subscriptions.size)for(let r of this.subscriptions)r(e,t,n)}clear(){this.subscriptions.clear()}};function P(e){return!Number.isNaN(Number.parseFloat(e))}var Me=class{constructor(t){e.defineProperty(this,`current`,void 0),e.defineProperty(this,`prev`,void 0),e.defineProperty(this,`timeDelta`,0),e.defineProperty(this,`lastUpdated`,0),e.defineProperty(this,`updateSubscribers`,new je),e.defineProperty(this,`stopAnimation`,void 0),e.defineProperty(this,`canTrackVelocity`,!1),e.defineProperty(this,`updateAndNotify`,e=>{this.prev=this.current,this.current=e;let{delta:t,timestamp:n}=de();this.lastUpdated!==n&&(this.timeDelta=t,this.lastUpdated=n),ue.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)}),e.defineProperty(this,`scheduleVelocityCheck`,()=>ue.postRender(this.velocityCheck)),e.defineProperty(this,`velocityCheck`,({timestamp:e})=>{this.canTrackVelocity||=P(this.current),e!==this.lastUpdated&&(this.prev=this.current)}),this.prev=this.current=t,this.canTrackVelocity=P(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Oe(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{let{stop:n}=e(t);this.stopAnimation=n}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}};function Ne(e){return new Me(e)}const{isArray:Pe}=Array;function Fe(){let e=T({}),t=t=>{let n=t=>{e.value[t]&&(e.value[t].stop(),e.value[t].destroy(),delete e.value[t])};t?Pe(t)?t.forEach(n):n(t):Object.keys(e.value).forEach(n)},n=(t,n,r)=>{if(e.value[t])return e.value[t];let i=Ne(n);return i.onChange(e=>r[t]=e),e.value[t]=i,i};return Ce(t),{motionValues:e,get:n,stop:t}}function Ie(e){return Array.isArray(e)}function F(){return{type:`spring`,stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function I(e){return{type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Le(e){return{type:`spring`,stiffness:550,damping:e===0?100:30,restDelta:.01,restSpeed:10}}function L(){return{type:`keyframes`,ease:`linear`,duration:300}}function Re(e){return{type:`keyframes`,duration:800,values:e}}const R={default:Le,x:F,y:F,z:F,rotate:F,rotateX:F,rotateY:F,rotateZ:F,scaleX:I,scaleY:I,scale:I,backgroundColor:L,color:L,opacity:L};function z(e,t){let n;return n=Ie(t)?Re:R[e]||R.default,{to:t,...n(t)}}const B={...ve,transform:Math.round},V={color:d,backgroundColor:d,outlineColor:d,fill:d,stroke:d,borderColor:d,borderTopColor:d,borderRightColor:d,borderBottomColor:d,borderLeftColor:d,borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,radius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,size:C,top:C,right:C,bottom:C,left:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,rotate:v,rotateX:v,rotateY:v,rotateZ:v,scale:E,scaleX:E,scaleY:E,scaleZ:E,skew:v,skewX:v,skewY:v,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:r,originX:S,originY:S,originZ:C,zIndex:B,filter:y,WebkitFilter:y,fillOpacity:r,strokeOpacity:r,numOctaves:B},H=e=>V[e];function U(e,t){return t&&typeof e==`number`&&t.transform?t.transform(e):e}function ze(e,t){let n=H(e);return n!==y&&(n=ie),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Be={linear:he,easeIn:se,easeInOut:ce,easeOut:le,circIn:te,circInOut:ne,circOut:re,backIn:o,backInOut:s,backOut:c,anticipate:a,bounceIn:l,bounceInOut:u,bounceOut:ee};function W(e){if(Array.isArray(e)){let[t,n,r,i]=e;return ae(t,n,r,i)}else if(typeof e==`string`)return Be[e];return e}function Ve(e){return Array.isArray(e)&&typeof e[0]!=`number`}function G(e,t){return e===`zIndex`?!1:!!(typeof t==`number`||Array.isArray(t)||typeof t==`string`&&ie.test(t)&&!t.startsWith(`url(`))}function He(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function Ue({ease:e,times:t,delay:n,...r}){let i={...r};return t&&(i.offset=t),e&&(i.ease=Ve(e)?e.map(W):W(e)),n&&(i.elapsed=-n),i}function We(e,t,n){return Array.isArray(t.to)&&(e.duration||=800),He(t),Ge(e)||(e={...e,...z(n,t.to)}),{...t,...Ue(e)}}function Ge({delay:e,repeat:t,repeatType:n,repeatDelay:r,from:i,...a}){return!!Object.keys(a).length}function Ke(e,t){return e[t]||e.default||e}function qe(e,t,n,r,a){let o=Ke(r,e),s=o.from===null||o.from===void 0?t.get():o.from,c=G(e,n);s===`none`&&c&&typeof n==`string`&&(s=ze(e,n));let l=G(e,s);function u(c){let l={from:s,to:n,velocity:r.velocity?r.velocity:t.getVelocity(),onUpdate:e=>t.set(e)};return o.type===`inertia`||o.type===`decay`?fe({...l,...o}):i({...We(o,l,e),onUpdate:e=>{l.onUpdate(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{a&&a(),c&&c()}})}function ee(e){return t.set(n),a&&a(),e&&e(),{stop:()=>{}}}return!l||!c||o.type===!1?ee:u}function Je(){let{motionValues:e,stop:t,get:n}=Fe(),r=(e,t,r,i={},a)=>{let o=r[e],s=n(e,o,r);if(i&&i.immediate){s.set(t);return}let c=qe(e,s,t,i,a);s.start(c)};return{motionValues:e,stop:t,push:r}}function Ye(e,t={},{motionValues:n,push:r,stop:i}=Je()){let a=O(t),o=T(!1);M(n,e=>{o.value=Object.values(e).filter(e=>e.isAnimating()).length>0},{immediate:!0,deep:!0});let s=e=>{if(!a||!a[e])throw Error(`The variant ${e} does not exist.`);return a[e]},c=t=>{typeof t==`string`&&(t=s(t));let n=Object.entries(t).map(([n,i])=>{if(n!==`transition`)return new Promise(a=>r(n,i,e,t.transition||z(n,t[n]),a))}).filter(Boolean);async function i(){var e,r;await Promise.all(n),(e=t.transition)==null||(r=e.onComplete)==null||r.call(e)}return Promise.all([i()])},l=t=>{let n=me(t)?t:s(t);Object.entries(n).forEach(([t,n])=>{t!==`transition`&&r(t,n,e,{immediate:!0})})},u=async e=>{let t;if(a&&(a.leave&&(t=a.leave),!a.leave&&a.initial&&(t=a.initial)),!t){e();return}await c(t),e()};return{isAnimating:o,apply:c,set:l,leave:u,stop:i}}const K=typeof window<`u`,Xe=()=>K&&(window.onpointerdown===null||N?.TEST),Ze=()=>K&&(window.ontouchstart===null||N?.TEST),Qe=()=>K&&(window.onmousedown===null||N?.TEST);function $e({target:e,state:t,variants:n,apply:r}){let i=O(n),a=T(!1),o=T(!1),s=T(!1),c=f(()=>{let e=[...Object.keys(t.value||{})];return i?(i.hovered&&(e=[...e,...Object.keys(i.hovered)]),i.tapped&&(e=[...e,...Object.keys(i.tapped)]),i.focused&&(e=[...e,...Object.keys(i.focused)]),e):e}),l=f(()=>{let e={};for(let n in Object.assign(e,t.value),a.value&&i.hovered&&Object.assign(e,i.hovered),o.value&&i.tapped&&Object.assign(e,i.tapped),s.value&&i.focused&&Object.assign(e,i.focused),e)c.value.includes(n)||delete e[n];return e});i.hovered&&(k(e,`mouseenter`,()=>a.value=!0),k(e,`mouseleave`,()=>{a.value=!1,o.value=!1})),i.tapped&&(Qe()&&(k(e,`mousedown`,()=>o.value=!0),k(e,`mouseup`,()=>o.value=!1)),Xe()&&(k(e,`pointerdown`,()=>o.value=!0),k(e,`pointerup`,()=>o.value=!1)),Ze()&&(k(e,`touchstart`,()=>o.value=!0),k(e,`touchend`,()=>o.value=!1))),i.focused&&(k(e,`focus`,()=>s.value=!0),k(e,`blur`,()=>s.value=!1)),M([a,o,s],()=>{r(l.value)})}function et({set:e,target:t,variants:n,variant:r}){let i=O(n);M(()=>t,()=>{i&&(i.initial&&(e(`initial`),r.value=`initial`),i.enter&&(r.value=`enter`))},{immediate:!0,flush:`pre`})}function tt({state:e,apply:t}){M(e,e=>{e&&t(e)},{immediate:!0})}function nt({target:e,variants:t,variant:n}){let r=O(t);r&&(r.visible||r.visibleOnce)&&Ee(e,([{isIntersecting:e}])=>{r.visible?e?n.value=`visible`:n.value=`initial`:r.visibleOnce&&(e&&n.value!==`visibleOnce`?n.value=`visibleOnce`:n.value||=`initial`)})}function rt(e,t={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){t.lifeCycleHooks&&et(e),t.syncVariants&&tt(e),t.visibilityHooks&&nt(e),t.eventListeners&&$e(e)}function q(e={}){let t=w({...e}),n=T({});return M(t,()=>{let e={};for(let[n,r]of Object.entries(t)){let t=H(n),i=U(r,t);e[n]=i}n.value=e},{immediate:!0,deep:!0}),{state:t,style:n}}function J(e,t){M(()=>we(e),e=>{e&&t(e)},{immediate:!0})}const it={x:`translateX`,y:`translateY`,z:`translateZ`};function Y(e={},t=!0){let n=w({...e}),r=T(``);return M(n,e=>{let n=``,i=!1;if(t&&(e.x||e.y||e.z)){let t=[e.x||0,e.y||0,e.z||0].map(e=>U(e,C)).join(`,`);n+=`translate3d(${t}) `,i=!0}for(let[r,i]of Object.entries(e)){if(t&&(r===`x`||r===`y`||r===`z`))continue;let e=H(r),a=U(i,e);n+=`${it[r]||r}(${a}) `}t&&!i&&(n+=`translateZ(0px) `),r.value=n.trim()},{immediate:!0,deep:!0}),{state:n,transform:r}}const at=[``,`X`,`Y`,`Z`],ot=[`perspective`,`translate`,`scale`,`rotate`,`skew`],X=[`transformPerspective`,`x`,`y`,`z`];ot.forEach(e=>{at.forEach(t=>{let n=e+t;X.push(n)})});const st=new Set(X);function Z(e){return st.has(e)}const ct=new Set([`originX`,`originY`,`originZ`]);function lt(e){return ct.has(e)}function ut(e){let t={},n={};return Object.entries(e).forEach(([e,r])=>{Z(e)||lt(e)?t[e]=r:n[e]=r}),{transform:t,style:n}}function Q(e){let{transform:t,style:n}=ut(e),{transform:r}=Y(t),{style:i}=q(n);return r.value&&(i.value.transform=r.value),i.value}function dt(e,t){let n,r,{state:i,style:a}=q();return J(e,e=>{r=e;for(let t of Object.keys(V)){if(e.style[t]===null||e.style[t]===``||Z(t)||lt(t))continue;i[t]=e.style[t]}n&&Object.entries(n).forEach(([t,n])=>e.style[t]=n),t&&t(i)}),M(a,e=>{if(!r){n=e;return}for(let t in e)r.style[t]=e[t]},{immediate:!0}),{style:i}}function ft(e){let t=e.trim().split(/\) |\)/);if(t.length===1)return{};let n=e=>e.endsWith(`px`)||e.endsWith(`deg`)?Number.parseFloat(e):Number.isNaN(Number(e))?Number(e):e;return t.reduce((e,t)=>{if(!t)return e;let[r,i]=t.split(`(`),a=i.split(`,`),o=a.map(e=>n(e.endsWith(`)`)?e.replace(`)`,``):e.trim())),s=o.length===1?o[0]:o;return{...e,[r]:s}},{})}function pt(e,t){Object.entries(ft(t)).forEach(([t,n])=>{let r=[`x`,`y`,`z`];if(t===`translate3d`){if(n===0){r.forEach(t=>e[t]=0);return}n.forEach((t,n)=>e[r[n]]=t);return}if(n=Number.parseFloat(`${n}`),t===`translateX`){e.x=n;return}if(t===`translateY`){e.y=n;return}if(t===`translateZ`){e.z=n;return}e[t]=n})}function mt(e,t){let n,r,{state:i,transform:a}=Y();return J(e,e=>{r=e,e.style.transform&&pt(i,e.style.transform),n&&(e.style.transform=n),t&&t(i)}),M(a,e=>{if(!r){n=e;return}r.style.transform=e},{immediate:!0}),{transform:i}}function ht(e){return Object.entries(e)}function gt(e,t){let n=w({}),r=e=>Object.entries(e).forEach(([e,t])=>n[e]=t),{style:i}=dt(e,r),{transform:a}=mt(e,r);return M(n,e=>{ht(e).forEach(([e,t])=>{let n=Z(e)?a:i;n[e]&&n[e]===t||(n[e]=t)})},{immediate:!0,deep:!0}),J(e,()=>t&&r(t)),{motionProperties:n,style:i,transform:a}}function _t(e={}){let t=O(e),n=T(),r=f(()=>{if(n.value)return t[n.value]});return{state:r,variant:n}}function vt(e,t={},n){let{motionProperties:r}=gt(e),{variant:i,state:a}=_t(t),o=Ye(r,t),s={target:e,variant:i,variants:t,state:a,motionProperties:r,...o};return rt(s,n),s}const yt=[`delay`,`duration`],bt=[`initial`,`enter`,`leave`,`visible`,`visible-once`,`visibleOnce`,`hovered`,`tapped`,`focused`,...yt],xt={initial:{opacity:0},enter:{opacity:1}},St={initial:{opacity:0},visible:{opacity:1}},Ct={initial:{opacity:0},visibleOnce:{opacity:1}},wt={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},Tt={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},Et={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},Dt={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},Ot={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},kt={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},At={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},jt={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},Mt={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},Nt={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},Pt={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Ft={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},It={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},Lt={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Rt={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},zt={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},Bt={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},Vt={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},Ht={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Ut={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},Wt={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},Gt={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},Kt={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},qt={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},Jt={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},Yt={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},Xt={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Zt={__proto__:null,fade:xt,fadeVisible:St,fadeVisibleOnce:Ct,pop:wt,popVisible:Tt,popVisibleOnce:Et,rollBottom:It,rollLeft:Dt,rollRight:At,rollTop:Nt,rollVisibleBottom:Lt,rollVisibleLeft:Ot,rollVisibleOnceBottom:Rt,rollVisibleOnceLeft:kt,rollVisibleOnceRight:Mt,rollVisibleOnceTop:Ft,rollVisibleRight:jt,rollVisibleTop:Pt,slideBottom:Jt,slideLeft:zt,slideRight:Ht,slideTop:Gt,slideVisibleBottom:Yt,slideVisibleLeft:Bt,slideVisibleOnceBottom:Xt,slideVisibleOnceLeft:Vt,slideVisibleOnceRight:Wt,slideVisibleOnceTop:qt,slideVisibleRight:Ut,slideVisibleTop:Kt},Qt=Symbol(``),$t={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function en(e){return Object.prototype.toString.call(e)===`[object Object]`}function $(e){if(Array.isArray(e))return e.map($);if(en(e)){let t={};for(let n in e)t[n]=$(e[n]);return t}return e}function tn(e){let t=w({}),n=pe(Qt,{}),r=f(()=>e.preset==null?{}:n!=null&&e.preset in n?structuredClone(Se(n)[e.preset]):e.preset in Zt?structuredClone(Zt[e.preset]):{}),i=f(()=>({initial:e.initial,enter:e.enter,leave:e.leave,visible:e.visible,visibleOnce:e.visibleOnce,hovered:e.hovered,tapped:e.tapped,focused:e.focused}));function a(e,t){for(let n of[`delay`,`duration`]){if(t[n]==null)continue;let r=Number.parseInt(t[n]);for(let t of[`enter`,`visible`,`visibleOnce`]){let i=e[t];if(i==null)continue;i.transition??={},i.transition[n]=r}}return e}let o=f(()=>{let t=oe({},i.value,r.value,e.variants||{});return a({...t},e)});function s(e,n,r){var i;e.props??={},(i=e.props).style??(i.style={}),e.props.style={...e.props.style,...r};let s=a($(o.value),e.props);return e.props.onVnodeMounted=({el:e})=>{t[n]=vt(e,s)},e.props.onVnodeUpdated=({el:e})=>{let r=Q(t[n].state);for(let[t,n]of Object.entries(r))e.style[t]=n},e}return{motionConfig:o,setNodeInstance:s}}const nn=_({name:`Motion`,props:{...$t,is:{type:[String,Object],default:`div`}},setup(e){let t=j(),{motionConfig:n,setNodeInstance:r}=tn(e);return()=>{let i=Q(n.value.initial||{}),a=b(e.is,void 0,t);return r(a,0,i),a}}}),rn=_({name:`MotionGroup`,props:{...$t,is:{type:[String,Object],required:!1}},setup(e){let n=j(),{motionConfig:r,setNodeInstance:i}=tn(e);return()=>{var a;let o=Q(r.value.initial||{}),s=(a=n.default)?.call(n)||[];for(let e=0;e{await c(`initial`),await c(`enter`)}),be(async()=>{await c(`leave`),s.value=!0}),M([()=>t.title,()=>t.subtitle,r],async()=>{await c(`leave`),await ge(),s.value=t.disableBackButton,a.value=t.title,o.value=t.subtitle,await ge(),await c(`initial`),await c(`enter`)}),(t,r)=>(x(),h(`div`,{ref_key:`pageHeaderRef`,ref:i,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`},[p(`button`,{onClick:r[0]||=e=>O(n).back()},[s.value?m(``,!0):(x(),h(`div`,{key:0,"i-solar:alt-arrow-left-line-duotone":``,"text-2xl":``,class:_e({"pointer-events-none op-0":!e.showBackButton})},null,2))]),p(`h1`,an,[o.value?(x(),h(`div`,on,[p(`span`,sn,D(o.value),1)])):m(``,!0),p(`div`,cn,D(a.value),1)])],512))}}),un=ln;const dn={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)`}},fn={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},pn={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"mx-auto":``,"max-w-screen-xl":``};var mn=_({__name:`settings`,setup(e){let t=A(),{t:r}=Te(),i=ke(),{allProvidersMetadata:a}=xe(i),o=f(()=>{let e={"/settings/airi-card":{subtitle:r(`settings.title`),title:r(`settings.pages.card.title`)},"/settings/appearance":{subtitle:r(`settings.title`),title:r(`settings.pages.themes.title`)},"/settings/appearance/general":{subtitle:r(`settings.title`),title:r(`settings.pages.themes.general.title`)},"/settings/appearance/color-scheme":{subtitle:r(`settings.title`),title:r(`settings.pages.themes.color-scheme.title`)},"/settings/appearance/developer":{subtitle:r(`settings.title`),title:r(`settings.pages.themes.developer.title`)},"/settings/memory":{subtitle:r(`settings.title`),title:r(`settings.pages.memory.title`)},"/settings/models":{subtitle:r(`settings.title`),title:r(`settings.pages.models.title`)},"/settings/modules":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.title`)},"/settings/modules/consciousness":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.consciousness.title`)},"/settings/modules/speech":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.speech.title`)},"/settings/modules/hearing":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.hearing.title`)},"/settings/modules/memory-short-term":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.memory-short-term.title`)},"/settings/modules/memory-long-term":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.memory-long-term.title`)},"/settings/modules/messaging-discord":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.messaging-discord.title`)},"/settings/modules/x":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.x.title`)},"/settings/modules/gaming-minecraft":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.gaming-minecraft.title`)},"/settings/modules/gaming-factorio":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.gaming-factorio.title`)},"/settings/providers":{subtitle:r(`settings.title`),title:r(`settings.pages.providers.title`)},"/settings/scene":{subtitle:r(`settings.title`),title:r(`settings.pages.scene.title`)},"/settings":{title:r(`settings.title`)}};for(let t of a.value)e[`/settings/providers/${t.id}`]={subtitle:r(`settings.title`),title:r(t.nameKey)};return e}),s=f(()=>o.value[t.path]);return(e,t)=>{var r,i;return x(),h(`div`,dn,[p(`div`,fn,[g(Ae)]),p(`div`,pn,[g(O(un),{title:(r=s.value)?.title,subtitle:(i=s.value)?.subtitle},null,8,[`title`,`subtitle`]),g(O(n))])])}}}),hn=mn;export{hn as default}; \ No newline at end of file +var e=function(exports){function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}return exports.defineProperty=i,exports}({});import{Fragment as t,RouterView as n,alpha as r,animate as i,anticipate as a,backIn as o,backInOut as s,backOut as c,bounceIn as l,bounceInOut as u,bounceOut as ee,circIn as te,circInOut as ne,circOut as re,color as d,complex as ie,computed as f,createBaseVNode as p,createCommentVNode as m,createElementBlock as h,createVNode as g,cubicBezier as ae,defineComponent as _,defu as oe,degrees as v,easeIn as se,easeInOut as ce,easeOut as le,es_default as ue,filter as y,getFrameData as de,h as b,inertia as fe,inject as pe,isObject as me,linear as he,nextTick as ge,normalizeClass as _e,number as ve,onMounted as ye,onUnmounted as be,openBlock as x,progressPercentage as S,px as C,reactive as w,ref as T,scale as E,storeToRefs as xe,toDisplayString as D,toRaw as Se,tryOnUnmounted as Ce,unref as O,unrefElement as we,useEventListener as k,useI18n as Te,useIntersectionObserver as Ee,useRoute as A,useRouter as De,useSlots as j,velocityPerSecond as Oe,watch as M}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as ke}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import{HeaderLink_default as Ae}from"./HeaderLink-vGMDgqa7.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";const N={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_TARGET_HUGGINGFACE_SPACE:`true`};var je=class{constructor(){e.defineProperty(this,`subscriptions`,new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,n){if(this.subscriptions.size)for(let r of this.subscriptions)r(e,t,n)}clear(){this.subscriptions.clear()}};function P(e){return!Number.isNaN(Number.parseFloat(e))}var Me=class{constructor(t){e.defineProperty(this,`current`,void 0),e.defineProperty(this,`prev`,void 0),e.defineProperty(this,`timeDelta`,0),e.defineProperty(this,`lastUpdated`,0),e.defineProperty(this,`updateSubscribers`,new je),e.defineProperty(this,`stopAnimation`,void 0),e.defineProperty(this,`canTrackVelocity`,!1),e.defineProperty(this,`updateAndNotify`,e=>{this.prev=this.current,this.current=e;let{delta:t,timestamp:n}=de();this.lastUpdated!==n&&(this.timeDelta=t,this.lastUpdated=n),ue.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)}),e.defineProperty(this,`scheduleVelocityCheck`,()=>ue.postRender(this.velocityCheck)),e.defineProperty(this,`velocityCheck`,({timestamp:e})=>{this.canTrackVelocity||=P(this.current),e!==this.lastUpdated&&(this.prev=this.current)}),this.prev=this.current=t,this.canTrackVelocity=P(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Oe(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{let{stop:n}=e(t);this.stopAnimation=n}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}};function Ne(e){return new Me(e)}const{isArray:Pe}=Array;function Fe(){let e=T({}),t=t=>{let n=t=>{e.value[t]&&(e.value[t].stop(),e.value[t].destroy(),delete e.value[t])};t?Pe(t)?t.forEach(n):n(t):Object.keys(e.value).forEach(n)},n=(t,n,r)=>{if(e.value[t])return e.value[t];let i=Ne(n);return i.onChange(e=>r[t]=e),e.value[t]=i,i};return Ce(t),{motionValues:e,get:n,stop:t}}function Ie(e){return Array.isArray(e)}function F(){return{type:`spring`,stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function I(e){return{type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Le(e){return{type:`spring`,stiffness:550,damping:e===0?100:30,restDelta:.01,restSpeed:10}}function L(){return{type:`keyframes`,ease:`linear`,duration:300}}function Re(e){return{type:`keyframes`,duration:800,values:e}}const R={default:Le,x:F,y:F,z:F,rotate:F,rotateX:F,rotateY:F,rotateZ:F,scaleX:I,scaleY:I,scale:I,backgroundColor:L,color:L,opacity:L};function z(e,t){let n;return n=Ie(t)?Re:R[e]||R.default,{to:t,...n(t)}}const B={...ve,transform:Math.round},V={color:d,backgroundColor:d,outlineColor:d,fill:d,stroke:d,borderColor:d,borderTopColor:d,borderRightColor:d,borderBottomColor:d,borderLeftColor:d,borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,radius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,size:C,top:C,right:C,bottom:C,left:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,rotate:v,rotateX:v,rotateY:v,rotateZ:v,scale:E,scaleX:E,scaleY:E,scaleZ:E,skew:v,skewX:v,skewY:v,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:r,originX:S,originY:S,originZ:C,zIndex:B,filter:y,WebkitFilter:y,fillOpacity:r,strokeOpacity:r,numOctaves:B},H=e=>V[e];function U(e,t){return t&&typeof e==`number`&&t.transform?t.transform(e):e}function ze(e,t){let n=H(e);return n!==y&&(n=ie),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Be={linear:he,easeIn:se,easeInOut:ce,easeOut:le,circIn:te,circInOut:ne,circOut:re,backIn:o,backInOut:s,backOut:c,anticipate:a,bounceIn:l,bounceInOut:u,bounceOut:ee};function W(e){if(Array.isArray(e)){let[t,n,r,i]=e;return ae(t,n,r,i)}else if(typeof e==`string`)return Be[e];return e}function Ve(e){return Array.isArray(e)&&typeof e[0]!=`number`}function G(e,t){return e===`zIndex`?!1:!!(typeof t==`number`||Array.isArray(t)||typeof t==`string`&&ie.test(t)&&!t.startsWith(`url(`))}function He(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function Ue({ease:e,times:t,delay:n,...r}){let i={...r};return t&&(i.offset=t),e&&(i.ease=Ve(e)?e.map(W):W(e)),n&&(i.elapsed=-n),i}function We(e,t,n){return Array.isArray(t.to)&&(e.duration||=800),He(t),Ge(e)||(e={...e,...z(n,t.to)}),{...t,...Ue(e)}}function Ge({delay:e,repeat:t,repeatType:n,repeatDelay:r,from:i,...a}){return!!Object.keys(a).length}function Ke(e,t){return e[t]||e.default||e}function qe(e,t,n,r,a){let o=Ke(r,e),s=o.from===null||o.from===void 0?t.get():o.from,c=G(e,n);s===`none`&&c&&typeof n==`string`&&(s=ze(e,n));let l=G(e,s);function u(c){let l={from:s,to:n,velocity:r.velocity?r.velocity:t.getVelocity(),onUpdate:e=>t.set(e)};return o.type===`inertia`||o.type===`decay`?fe({...l,...o}):i({...We(o,l,e),onUpdate:e=>{l.onUpdate(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{a&&a(),c&&c()}})}function ee(e){return t.set(n),a&&a(),e&&e(),{stop:()=>{}}}return!l||!c||o.type===!1?ee:u}function Je(){let{motionValues:e,stop:t,get:n}=Fe(),r=(e,t,r,i={},a)=>{let o=r[e],s=n(e,o,r);if(i&&i.immediate){s.set(t);return}let c=qe(e,s,t,i,a);s.start(c)};return{motionValues:e,stop:t,push:r}}function Ye(e,t={},{motionValues:n,push:r,stop:i}=Je()){let a=O(t),o=T(!1);M(n,e=>{o.value=Object.values(e).filter(e=>e.isAnimating()).length>0},{immediate:!0,deep:!0});let s=e=>{if(!a||!a[e])throw Error(`The variant ${e} does not exist.`);return a[e]},c=t=>{typeof t==`string`&&(t=s(t));let n=Object.entries(t).map(([n,i])=>{if(n!==`transition`)return new Promise(a=>r(n,i,e,t.transition||z(n,t[n]),a))}).filter(Boolean);async function i(){var e,r;await Promise.all(n),(e=t.transition)==null||(r=e.onComplete)==null||r.call(e)}return Promise.all([i()])},l=t=>{let n=me(t)?t:s(t);Object.entries(n).forEach(([t,n])=>{t!==`transition`&&r(t,n,e,{immediate:!0})})},u=async e=>{let t;if(a&&(a.leave&&(t=a.leave),!a.leave&&a.initial&&(t=a.initial)),!t){e();return}await c(t),e()};return{isAnimating:o,apply:c,set:l,leave:u,stop:i}}const K=typeof window<`u`,Xe=()=>K&&(window.onpointerdown===null||N?.TEST),Ze=()=>K&&(window.ontouchstart===null||N?.TEST),Qe=()=>K&&(window.onmousedown===null||N?.TEST);function $e({target:e,state:t,variants:n,apply:r}){let i=O(n),a=T(!1),o=T(!1),s=T(!1),c=f(()=>{let e=[...Object.keys(t.value||{})];return i?(i.hovered&&(e=[...e,...Object.keys(i.hovered)]),i.tapped&&(e=[...e,...Object.keys(i.tapped)]),i.focused&&(e=[...e,...Object.keys(i.focused)]),e):e}),l=f(()=>{let e={};for(let n in Object.assign(e,t.value),a.value&&i.hovered&&Object.assign(e,i.hovered),o.value&&i.tapped&&Object.assign(e,i.tapped),s.value&&i.focused&&Object.assign(e,i.focused),e)c.value.includes(n)||delete e[n];return e});i.hovered&&(k(e,`mouseenter`,()=>a.value=!0),k(e,`mouseleave`,()=>{a.value=!1,o.value=!1})),i.tapped&&(Qe()&&(k(e,`mousedown`,()=>o.value=!0),k(e,`mouseup`,()=>o.value=!1)),Xe()&&(k(e,`pointerdown`,()=>o.value=!0),k(e,`pointerup`,()=>o.value=!1)),Ze()&&(k(e,`touchstart`,()=>o.value=!0),k(e,`touchend`,()=>o.value=!1))),i.focused&&(k(e,`focus`,()=>s.value=!0),k(e,`blur`,()=>s.value=!1)),M([a,o,s],()=>{r(l.value)})}function et({set:e,target:t,variants:n,variant:r}){let i=O(n);M(()=>t,()=>{i&&(i.initial&&(e(`initial`),r.value=`initial`),i.enter&&(r.value=`enter`))},{immediate:!0,flush:`pre`})}function tt({state:e,apply:t}){M(e,e=>{e&&t(e)},{immediate:!0})}function nt({target:e,variants:t,variant:n}){let r=O(t);r&&(r.visible||r.visibleOnce)&&Ee(e,([{isIntersecting:e}])=>{r.visible?e?n.value=`visible`:n.value=`initial`:r.visibleOnce&&(e&&n.value!==`visibleOnce`?n.value=`visibleOnce`:n.value||=`initial`)})}function rt(e,t={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){t.lifeCycleHooks&&et(e),t.syncVariants&&tt(e),t.visibilityHooks&&nt(e),t.eventListeners&&$e(e)}function q(e={}){let t=w({...e}),n=T({});return M(t,()=>{let e={};for(let[n,r]of Object.entries(t)){let t=H(n),i=U(r,t);e[n]=i}n.value=e},{immediate:!0,deep:!0}),{state:t,style:n}}function J(e,t){M(()=>we(e),e=>{e&&t(e)},{immediate:!0})}const it={x:`translateX`,y:`translateY`,z:`translateZ`};function Y(e={},t=!0){let n=w({...e}),r=T(``);return M(n,e=>{let n=``,i=!1;if(t&&(e.x||e.y||e.z)){let t=[e.x||0,e.y||0,e.z||0].map(e=>U(e,C)).join(`,`);n+=`translate3d(${t}) `,i=!0}for(let[r,i]of Object.entries(e)){if(t&&(r===`x`||r===`y`||r===`z`))continue;let e=H(r),a=U(i,e);n+=`${it[r]||r}(${a}) `}t&&!i&&(n+=`translateZ(0px) `),r.value=n.trim()},{immediate:!0,deep:!0}),{state:n,transform:r}}const at=[``,`X`,`Y`,`Z`],ot=[`perspective`,`translate`,`scale`,`rotate`,`skew`],X=[`transformPerspective`,`x`,`y`,`z`];ot.forEach(e=>{at.forEach(t=>{let n=e+t;X.push(n)})});const st=new Set(X);function Z(e){return st.has(e)}const ct=new Set([`originX`,`originY`,`originZ`]);function lt(e){return ct.has(e)}function ut(e){let t={},n={};return Object.entries(e).forEach(([e,r])=>{Z(e)||lt(e)?t[e]=r:n[e]=r}),{transform:t,style:n}}function Q(e){let{transform:t,style:n}=ut(e),{transform:r}=Y(t),{style:i}=q(n);return r.value&&(i.value.transform=r.value),i.value}function dt(e,t){let n,r,{state:i,style:a}=q();return J(e,e=>{r=e;for(let t of Object.keys(V)){if(e.style[t]===null||e.style[t]===``||Z(t)||lt(t))continue;i[t]=e.style[t]}n&&Object.entries(n).forEach(([t,n])=>e.style[t]=n),t&&t(i)}),M(a,e=>{if(!r){n=e;return}for(let t in e)r.style[t]=e[t]},{immediate:!0}),{style:i}}function ft(e){let t=e.trim().split(/\) |\)/);if(t.length===1)return{};let n=e=>e.endsWith(`px`)||e.endsWith(`deg`)?Number.parseFloat(e):Number.isNaN(Number(e))?Number(e):e;return t.reduce((e,t)=>{if(!t)return e;let[r,i]=t.split(`(`),a=i.split(`,`),o=a.map(e=>n(e.endsWith(`)`)?e.replace(`)`,``):e.trim())),s=o.length===1?o[0]:o;return{...e,[r]:s}},{})}function pt(e,t){Object.entries(ft(t)).forEach(([t,n])=>{let r=[`x`,`y`,`z`];if(t===`translate3d`){if(n===0){r.forEach(t=>e[t]=0);return}n.forEach((t,n)=>e[r[n]]=t);return}if(n=Number.parseFloat(`${n}`),t===`translateX`){e.x=n;return}if(t===`translateY`){e.y=n;return}if(t===`translateZ`){e.z=n;return}e[t]=n})}function mt(e,t){let n,r,{state:i,transform:a}=Y();return J(e,e=>{r=e,e.style.transform&&pt(i,e.style.transform),n&&(e.style.transform=n),t&&t(i)}),M(a,e=>{if(!r){n=e;return}r.style.transform=e},{immediate:!0}),{transform:i}}function ht(e){return Object.entries(e)}function gt(e,t){let n=w({}),r=e=>Object.entries(e).forEach(([e,t])=>n[e]=t),{style:i}=dt(e,r),{transform:a}=mt(e,r);return M(n,e=>{ht(e).forEach(([e,t])=>{let n=Z(e)?a:i;n[e]&&n[e]===t||(n[e]=t)})},{immediate:!0,deep:!0}),J(e,()=>t&&r(t)),{motionProperties:n,style:i,transform:a}}function _t(e={}){let t=O(e),n=T(),r=f(()=>{if(n.value)return t[n.value]});return{state:r,variant:n}}function vt(e,t={},n){let{motionProperties:r}=gt(e),{variant:i,state:a}=_t(t),o=Ye(r,t),s={target:e,variant:i,variants:t,state:a,motionProperties:r,...o};return rt(s,n),s}const yt=[`delay`,`duration`],bt=[`initial`,`enter`,`leave`,`visible`,`visible-once`,`visibleOnce`,`hovered`,`tapped`,`focused`,...yt],xt={initial:{opacity:0},enter:{opacity:1}},St={initial:{opacity:0},visible:{opacity:1}},Ct={initial:{opacity:0},visibleOnce:{opacity:1}},wt={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},Tt={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},Et={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},Dt={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},Ot={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},kt={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},At={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},jt={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},Mt={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},Nt={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},Pt={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Ft={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},It={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},Lt={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Rt={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},zt={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},Bt={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},Vt={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},Ht={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Ut={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},Wt={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},Gt={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},Kt={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},qt={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},Jt={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},Yt={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},Xt={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Zt={__proto__:null,fade:xt,fadeVisible:St,fadeVisibleOnce:Ct,pop:wt,popVisible:Tt,popVisibleOnce:Et,rollBottom:It,rollLeft:Dt,rollRight:At,rollTop:Nt,rollVisibleBottom:Lt,rollVisibleLeft:Ot,rollVisibleOnceBottom:Rt,rollVisibleOnceLeft:kt,rollVisibleOnceRight:Mt,rollVisibleOnceTop:Ft,rollVisibleRight:jt,rollVisibleTop:Pt,slideBottom:Jt,slideLeft:zt,slideRight:Ht,slideTop:Gt,slideVisibleBottom:Yt,slideVisibleLeft:Bt,slideVisibleOnceBottom:Xt,slideVisibleOnceLeft:Vt,slideVisibleOnceRight:Wt,slideVisibleOnceTop:qt,slideVisibleRight:Ut,slideVisibleTop:Kt},Qt=Symbol(``),$t={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function en(e){return Object.prototype.toString.call(e)===`[object Object]`}function $(e){if(Array.isArray(e))return e.map($);if(en(e)){let t={};for(let n in e)t[n]=$(e[n]);return t}return e}function tn(e){let t=w({}),n=pe(Qt,{}),r=f(()=>e.preset==null?{}:n!=null&&e.preset in n?structuredClone(Se(n)[e.preset]):e.preset in Zt?structuredClone(Zt[e.preset]):{}),i=f(()=>({initial:e.initial,enter:e.enter,leave:e.leave,visible:e.visible,visibleOnce:e.visibleOnce,hovered:e.hovered,tapped:e.tapped,focused:e.focused}));function a(e,t){for(let n of[`delay`,`duration`]){if(t[n]==null)continue;let r=Number.parseInt(t[n]);for(let t of[`enter`,`visible`,`visibleOnce`]){let i=e[t];if(i==null)continue;i.transition??={},i.transition[n]=r}}return e}let o=f(()=>{let t=oe({},i.value,r.value,e.variants||{});return a({...t},e)});function s(e,n,r){var i;e.props??={},(i=e.props).style??(i.style={}),e.props.style={...e.props.style,...r};let s=a($(o.value),e.props);return e.props.onVnodeMounted=({el:e})=>{t[n]=vt(e,s)},e.props.onVnodeUpdated=({el:e})=>{let r=Q(t[n].state);for(let[t,n]of Object.entries(r))e.style[t]=n},e}return{motionConfig:o,setNodeInstance:s}}const nn=_({name:`Motion`,props:{...$t,is:{type:[String,Object],default:`div`}},setup(e){let t=j(),{motionConfig:n,setNodeInstance:r}=tn(e);return()=>{let i=Q(n.value.initial||{}),a=b(e.is,void 0,t);return r(a,0,i),a}}}),rn=_({name:`MotionGroup`,props:{...$t,is:{type:[String,Object],required:!1}},setup(e){let n=j(),{motionConfig:r,setNodeInstance:i}=tn(e);return()=>{var a;let o=Q(r.value.initial||{}),s=(a=n.default)?.call(n)||[];for(let e=0;e{await c(`initial`),await c(`enter`)}),be(async()=>{await c(`leave`),s.value=!0}),M([()=>t.title,()=>t.subtitle,r],async()=>{await c(`leave`),await ge(),s.value=t.disableBackButton,a.value=t.title,o.value=t.subtitle,await ge(),await c(`initial`),await c(`enter`)}),(t,r)=>(x(),h(`div`,{ref_key:`pageHeaderRef`,ref:i,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`},[p(`button`,{onClick:r[0]||=e=>O(n).back()},[s.value?m(``,!0):(x(),h(`div`,{key:0,"i-solar:alt-arrow-left-line-duotone":``,"text-2xl":``,class:_e({"pointer-events-none op-0":!e.showBackButton})},null,2))]),p(`h1`,an,[o.value?(x(),h(`div`,on,[p(`span`,sn,D(o.value),1)])):m(``,!0),p(`div`,cn,D(a.value),1)])],512))}}),un=ln;const dn={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)`}},fn={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},pn={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"mx-auto":``,"max-w-screen-xl":``};var mn=_({__name:`settings`,setup(e){let t=A(),{t:r}=Te(),i=ke(),{allProvidersMetadata:a}=xe(i),o=f(()=>{let e={"/settings/airi-card":{subtitle:r(`settings.title`),title:r(`settings.pages.card.title`)},"/settings/appearance":{subtitle:r(`settings.title`),title:r(`settings.pages.themes.title`)},"/settings/appearance/general":{subtitle:r(`settings.title`),title:r(`settings.pages.themes.general.title`)},"/settings/appearance/color-scheme":{subtitle:r(`settings.title`),title:r(`settings.pages.themes.color-scheme.title`)},"/settings/appearance/developer":{subtitle:r(`settings.title`),title:r(`settings.pages.themes.developer.title`)},"/settings/memory":{subtitle:r(`settings.title`),title:r(`settings.pages.memory.title`)},"/settings/models":{subtitle:r(`settings.title`),title:r(`settings.pages.models.title`)},"/settings/modules":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.title`)},"/settings/modules/consciousness":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.consciousness.title`)},"/settings/modules/speech":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.speech.title`)},"/settings/modules/hearing":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.hearing.title`)},"/settings/modules/memory-short-term":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.memory-short-term.title`)},"/settings/modules/memory-long-term":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.memory-long-term.title`)},"/settings/modules/messaging-discord":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.messaging-discord.title`)},"/settings/modules/x":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.x.title`)},"/settings/modules/gaming-minecraft":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.gaming-minecraft.title`)},"/settings/modules/gaming-factorio":{subtitle:r(`settings.title`),title:r(`settings.pages.modules.gaming-factorio.title`)},"/settings/providers":{subtitle:r(`settings.title`),title:r(`settings.pages.providers.title`)},"/settings/scene":{subtitle:r(`settings.title`),title:r(`settings.pages.scene.title`)},"/settings":{title:r(`settings.title`)}};for(let t of a.value)e[`/settings/providers/${t.id}`]={subtitle:r(`settings.title`),title:r(t.nameKey)};return e}),s=f(()=>o.value[t.path]);return(e,t)=>{var r,i;return x(),h(`div`,dn,[p(`div`,fn,[g(Ae)]),p(`div`,pn,[g(O(un),{title:(r=s.value)?.title,subtitle:(i=s.value)?.subtitle},null,8,[`title`,`subtitle`]),g(O(n))])])}}}),hn=mn;export{hn as default}; \ No newline at end of file diff --git a/assets/settings-Bw5r_FJh.js b/assets/settings-DWdpldbJ.js similarity index 86% rename from assets/settings-Bw5r_FJh.js rename to assets/settings-DWdpldbJ.js index 8fa3c0f0e8e879668c308f76a7a8bb2466b8096c..f2b7ff36a9854cc4c58abc494d9779cdfeaac766 100644 --- a/assets/settings-Bw5r_FJh.js +++ b/assets/settings-DWdpldbJ.js @@ -1 +1 @@ -import{Fragment as e,computed as t,createBaseVNode as n,createBlock as r,createElementBlock as i,defineComponent as a,nextTick as o,normalizeStyle as s,openBlock as c,ref as l,renderList as u,resolveDirective as d,unref as f,useI18n as p,useRouter as m,useSettings as h,withDirectives as g}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{IconItem_default as _}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as v}from"./route-block-CC3cgg4Q.js";import{IconAnimation_default as y}from"./IconAnimation-LJjhLEIS.js";const b={flex:`~ col gap-4`,"font-thin":``},x={flex:`~ col gap-4`},S={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},C={text:`60`,"i-solar:settings-bold-duotone":``};var w=a({__name:`index`,setup(a){let v=m(),w=l(!1),T=l(),E=l(),{t:D}=p(),O=l(``),k=l(``),A=l(!1),j=h();function M(){var e;(e=E.value)?.call(E)}async function N(e,t){let n=e.currentTarget,r=n.querySelector(`.menu-icon-item-icon`);if(!r)return;let i=r.getBoundingClientRect(),a=`${i.left}px, ${i.top}px`;O.value=t.icon,k.value=a,A.value=!0,await o(),w.value=!0}let P=v.beforeEach(async(e,t,n)=>{if(!j.usePageSpecificTransitions||j.disableTransitions){n();return}await new Promise(e=>{E.value=e}),P(),n()}),F=t(()=>[{title:D(`settings.pages.card.title`),description:D(`settings.pages.card.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/airi-card`},{title:D(`settings.pages.modules.title`),description:D(`settings.pages.modules.description`),icon:`i-solar:layers-bold-duotone`,to:`/settings/modules`},{title:D(`settings.pages.scene.title`),description:D(`settings.pages.scene.description`),icon:`i-solar:armchair-2-bold-duotone`,to:`/settings/scene`},{title:D(`settings.pages.models.title`),description:D(`settings.pages.models.description`),icon:`i-solar:people-nearby-bold-duotone`,to:`/settings/models`},{title:D(`settings.pages.memory.title`),description:D(`settings.pages.memory.description`),icon:`i-solar:leaf-bold-duotone`,to:`/settings/memory`},{title:D(`settings.pages.providers.title`),description:D(`settings.pages.providers.description`),icon:`i-solar:box-minimalistic-bold-duotone`,to:`/settings/providers`},{title:D(`settings.pages.themes.title`),description:D(`settings.pages.themes.description`),icon:`i-solar:filters-bold-duotone`,to:`/settings/appearance`}]);return(t,a)=>{let o=d(`motion`);return c(),i(`div`,b,[a[0]||=n(`div`,null,null,-1),n(`div`,x,[(c(!0),i(e,null,u(F.value,(e,t)=>g((c(),r(f(_),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:s({transitionDelay:`${t*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:t=>N(t,e)},null,8,[`style`,`title`,`description`,`icon`,`to`,`onClick`])),[[o]])),128))]),A.value&&!f(j).disableTransitions&&f(j).usePageSpecificTransitions?(c(),r(y,{key:0,ref_key:`iconAnimation`,ref:T,icon:O.value,"icon-size":6*1.2,position:k.value,duration:1e3,"text-color":`text-neutral-400/50 dark:text-neutral-600/20`,started:w.value,onAnimationEndedOnce:M},null,8,[`icon`,`position`,`started`])):g((c(),i(`div`,S,[g(n(`div`,C,null,512),[[o]])])),[[o]])])}}});typeof v==`function`&&v(w);var T=w;export{T as default}; \ No newline at end of file +import{Fragment as e,computed as t,createBaseVNode as n,createBlock as r,createElementBlock as i,defineComponent as a,nextTick as o,normalizeStyle as s,openBlock as c,ref as l,renderList as u,resolveDirective as d,unref as f,useI18n as p,useRouter as m,useSettings as h,withDirectives as g}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{IconItem_default as _}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as v}from"./route-block-CC3cgg4Q.js";import{IconAnimation_default as y}from"./IconAnimation-D-xhKJXy.js";const b={flex:`~ col gap-4`,"font-thin":``},x={flex:`~ col gap-4`},S={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},C={text:`60`,"i-solar:settings-bold-duotone":``};var w=a({__name:`index`,setup(a){let v=m(),w=l(!1),T=l(),E=l(),{t:D}=p(),O=l(``),k=l(``),A=l(!1),j=h();function M(){var e;(e=E.value)?.call(E)}async function N(e,t){let n=e.currentTarget,r=n.querySelector(`.menu-icon-item-icon`);if(!r)return;let i=r.getBoundingClientRect(),a=`${i.left}px, ${i.top}px`;O.value=t.icon,k.value=a,A.value=!0,await o(),w.value=!0}let P=v.beforeEach(async(e,t,n)=>{if(!j.usePageSpecificTransitions||j.disableTransitions){n();return}await new Promise(e=>{E.value=e}),P(),n()}),F=t(()=>[{title:D(`settings.pages.card.title`),description:D(`settings.pages.card.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/airi-card`},{title:D(`settings.pages.modules.title`),description:D(`settings.pages.modules.description`),icon:`i-solar:layers-bold-duotone`,to:`/settings/modules`},{title:D(`settings.pages.scene.title`),description:D(`settings.pages.scene.description`),icon:`i-solar:armchair-2-bold-duotone`,to:`/settings/scene`},{title:D(`settings.pages.models.title`),description:D(`settings.pages.models.description`),icon:`i-solar:people-nearby-bold-duotone`,to:`/settings/models`},{title:D(`settings.pages.memory.title`),description:D(`settings.pages.memory.description`),icon:`i-solar:leaf-bold-duotone`,to:`/settings/memory`},{title:D(`settings.pages.providers.title`),description:D(`settings.pages.providers.description`),icon:`i-solar:box-minimalistic-bold-duotone`,to:`/settings/providers`},{title:D(`settings.pages.themes.title`),description:D(`settings.pages.themes.description`),icon:`i-solar:filters-bold-duotone`,to:`/settings/appearance`}]);return(t,a)=>{let o=d(`motion`);return c(),i(`div`,b,[a[0]||=n(`div`,null,null,-1),n(`div`,x,[(c(!0),i(e,null,u(F.value,(e,t)=>g((c(),r(f(_),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:s({transitionDelay:`${t*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:t=>N(t,e)},null,8,[`style`,`title`,`description`,`icon`,`to`,`onClick`])),[[o]])),128))]),A.value&&!f(j).disableTransitions&&f(j).usePageSpecificTransitions?(c(),r(y,{key:0,ref_key:`iconAnimation`,ref:T,icon:O.value,"icon-size":6*1.2,position:k.value,duration:1e3,"text-color":`text-neutral-400/50 dark:text-neutral-600/20`,started:w.value,onAnimationEndedOnce:M},null,8,[`icon`,`position`,`started`])):g((c(),i(`div`,S,[g(n(`div`,C,null,512),[[o]])])),[[o]])])}}});typeof v==`function`&&v(w);var T=w;export{T as default}; \ No newline at end of file diff --git a/assets/sleep-CvjNLutj.js b/assets/sleep-JdatAils.js similarity index 100% rename from assets/sleep-CvjNLutj.js rename to assets/sleep-JdatAils.js diff --git a/assets/speech-CjA8Vt_G.js b/assets/speech-Bw68A32w.js similarity index 95% rename from assets/speech-CjA8Vt_G.js rename to assets/speech-Bw68A32w.js index 5a02f5dae4fee56fa4f18960496f94cbcd0e5395..4833e70cb008b99c42ed071dd1a3095186965f4a 100644 --- a/assets/speech-CjA8Vt_G.js +++ b/assets/speech-Bw68A32w.js @@ -1 +1 @@ -import{Fragment as e,RouterLink as t,createBaseVNode as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createVNode as o,defineComponent as ee,isRef as s,normalizeClass as te,onMounted as c,onUnmounted as l,openBlock as u,ref as d,renderList as ne,resolveDirective as re,storeToRefs as f,toDisplayString as p,unref as m,useI18n as ie,vModelSelect as ae,vModelText as oe,watch as se,withCtx as h,withDirectives as g}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{generateSpeech as ce,useProvidersStore as le,useSpeechStore as ue}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import{Skeleton_default as _}from"./Button-AEge-Qyg.js";import{FieldCheckbox_default as v,FieldInput_default as de,FieldRange_default as y}from"./src-CX9nVT7I.js";import"./Basic-BGRWPjtG.js";import{Textarea_default as fe}from"./Textarea-CuugR8VV.js";import{RadioCardManySelect_default as pe,RadioCardSimple_default as me,TestDummyMarker_default as he,VoiceCardManySelect_default as ge}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as b}from"./route-block-CC3cgg4Q.js";const _e={flex:`~ col md:row gap-6`},ve={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`w-full md:w-[40%]`},ye={flex:`~ col gap-4`},be={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},xe={text:`neutral-400 dark:neutral-500`},Se={"max-w-full":``},Ce={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},we={key:1},Te={key:0},x={flex:`~ col gap-4`},S={class:`text-lg md:text-2xl`},C={text:`neutral-400 dark:neutral-400`},w={key:0,class:`flex items-center justify-center py-4`},T={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`},E={class:`flex flex-col`},D={class:`font-medium`},O={class:`text-sm text-red-600 dark:text-red-400`},Ee={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`},De={class:`flex flex-col`},Oe={class:`font-medium`},ke={class:`text-sm text-amber-600 dark:text-amber-400`},Ae={key:0},je={flex:`~ col gap-4`},Me={key:0},Ne={class:`flex flex-col gap-4`},Pe={flex:`~ row gap-4`},Fe={key:1,class:`space-y-6`},Ie={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`},Le={class:`flex flex-col`},Re={class:`text-sm text-red-600 dark:text-red-400`},ze={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`},Be={flex:`~ col gap-4`},Ve={key:4,class:`mt-2 space-y-6`},He={key:0},Ue={flex:`~ col gap-4`},We={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ge={"w-full":``,"rounded-xl":``},k={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`},qe={flex:`~ col gap-4`},Je={flex:`~ row`,"gap-4":``},Ye=[`disabled`],Xe={flex:`~ row`,"items-center":``,"gap-2":``},Ze=[`src`],Qe={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var A=ee({__name:`speech`,setup(ee){let{t:b}=ie(),A=le(),j=ue(),{configuredSpeechProvidersMetadata:M}=f(A),{activeSpeechProvider:N,activeSpeechModel:P,activeSpeechVoice:F,activeSpeechVoiceId:I,pitch:L,isLoadingSpeechProviderVoices:$e,supportsModelListing:et,providerModels:R,isLoadingActiveProviderModels:z,activeProviderModelError:B,modelSearchQuery:V,speechProviderError:H,ssmlEnabled:U,availableVoices:W}=f(j),G=d(``),K=d(!1),q=d(`Hello, my name is AI Assistant`),J=d(``),Y=d(!1),X=d(``),Z=d(null),Q=d(``);c(async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)}),se(N,async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)});async function tt(){if(!q.value.trim()&&!K.value||K.value&&!J.value.trim())return;if(!P.value){console.error(`No model selected`);return}if(!F.value){console.error(`No voice selected`);return}let e=A.getProviderInstance(N.value);if(!e){console.error(`Failed to initialize speech provider`);return}let t=A.getProviderConfig(N.value);Y.value=!0,Q.value=``;try{X.value&&$();let n=K.value?J.value:j.generateSSML(q.value,F.value,{...t,pitch:L.value}),r=await ce({...e.speech(P.value,t),input:n,voice:F.value.id});X.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{Z.value&&Z.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),Q.value=e instanceof Error?e.message:`An unknown error occurred`}finally{Y.value=!1}}function $(){Z.value&&(Z.value.pause(),Z.value.currentTime=0),X.value&&(URL.revokeObjectURL(X.value),X.value=``)}l(()=>{X.value&&URL.revokeObjectURL(X.value)});function nt(e){F.value={id:e,name:e,description:e,previewURL:e,languages:[{code:`en`,title:`English`}],provider:N.value,gender:`male`}}function rt(e){P.value=e}return(ee,c)=>{var l;let d=re(`motion`);return u(),a(e,null,[n(`div`,_e,[n(`div`,ve,[n(`div`,null,[n(`div`,ye,[n(`div`,null,[n(`h2`,be,p(m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.title`)),1),n(`div`,xe,[n(`span`,null,p(m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.description`)),1)])]),n(`div`,Se,[m(M).length>0?(u(),a(`fieldset`,Ce,[(u(!0),a(e,null,ne(m(M),e=>(u(),r(m(me),{id:e.id,key:e.id,modelValue:m(N),"onUpdate:modelValue":c[0]||=e=>s(N)?N.value=e:null,name:`speech-provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(u(),a(`div`,we,[o(m(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:h(()=>c[13]||=[n(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,{class:`flex flex-col`},[n(`span`,{class:`font-medium`},`No Speech Providers Configured`),n(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your speech providers`)],-1),n(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[13]})]))])]),n(`div`,null,[m(N)&&m(et)?(u(),a(`div`,Te,[n(`div`,x,[n(`div`,null,[n(`h2`,S,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),n(`div`,C,[n(`span`,null,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),m(z)?(u(),a(`div`,w,[c[14]||=n(`div`,{class:`mr-2 animate-spin`},[n(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),n(`span`,null,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):m(B)?(u(),a(`div`,T,[c[15]||=n(`div`,{"i-solar:close-circle-line-duotone":``,class:`text-2xl text-red-500 dark:text-red-400`},null,-1),n(`div`,E,[n(`span`,D,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`)),1),n(`span`,O,p(m(B)),1)])])):m(R).length===0&&!m(z)?(u(),a(`div`,Ee,[c[16]||=n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,De,[n(`span`,Oe,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1),n(`span`,ke,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)])])):m(R).length>0?(u(),r(m(pe),{key:3,modelValue:m(P),"onUpdate:modelValue":c[1]||=e=>s(P)?P.value=e:null,"search-query":m(V),"onUpdate:searchQuery":c[2]||=e=>s(V)?V.value=e:null,items:m(R),searchable:!0,"search-placeholder":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:m(V)}),"search-results-text":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":rt},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`])):i(``,!0)])])):i(``,!0)])]),m(N)?(u(),a(`div`,Ae,[n(`div`,je,[c[27]||=n(`div`,null,[n(`h2`,{class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},` Voice Configuration `),n(`div`,{text:`neutral-400 dark:neutral-500`},[n(`span`,null,`Customize how your AI assistant speaks`)])],-1),m($e)?(u(),a(`div`,Me,[n(`div`,Ne,[o(m(_),{class:`w-full rounded-lg p-2.5 text-sm`},{default:h(()=>c[17]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[17]}),n(`div`,Pe,[o(m(_),{class:`w-full rounded-lg p-4 text-sm`},{default:h(()=>c[18]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[18]}),o(m(_),{class:`w-full rounded-lg p-4 text-sm`},{default:h(()=>c[19]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[19]}),o(m(_),{class:`w-full rounded-lg p-4 text-sm`},{default:h(()=>c[20]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[20]})]),o(m(_),{class:`w-full rounded-lg p-3 text-sm`},{default:h(()=>c[21]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[21]})])])):m(W)[m(N)]&&m(W)[m(N)].length>0?(u(),a(`div`,Fe,[o(m(ge),{"search-query":G.value,"onUpdate:searchQuery":c[3]||=e=>G.value=e,"voice-id":m(I),"onUpdate:voiceId":c[4]||=e=>s(I)?I.value=e:null,voices:(l=m(W)[m(N)])?.map(e=>({id:e.id,name:e.name,description:e.description,previewURL:e.previewURL,customizable:!1})),searchable:!0,"search-placeholder":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder`),"search-no-results-title":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`),"search-no-results-description":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`),"search-results-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results`,{count:0,total:0}),"custom-input-placeholder":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder`),"expand-button-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_more`),"collapse-button-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_less`),"play-button-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample`),"pause-button-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.pause`),"onUpdate:customValue":nt},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`])])):m(H)?(u(),a(`div`,Ie,[c[23]||=n(`div`,{"i-solar:close-circle-line-duotone":``,class:`text-2xl text-red-500 dark:text-red-400`},null,-1),n(`div`,Le,[c[22]||=n(`span`,{class:`font-medium`},`Error loading voices`,-1),n(`span`,Re,p(m(H)),1)])])):(u(),a(`div`,ze,c[24]||=[n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,{class:`flex flex-col`},[n(`span`,{class:`font-medium`},`No voices available`),n(`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)])),n(`div`,Be,[o(m(y),{modelValue:m(L),"onUpdate:modelValue":c[5]||=e=>s(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`]),o(m(v),{modelValue:m(U),"onUpdate:modelValue":c[6]||=e=>s(U)?U.value=e:null,label:`Enable SSML`,description:`Enable Speech Synthesis Markup Language for more control over speech output`},null,8,[`modelValue`])]),!m(W)[m(N)]||m(W)[m(N)].length===0?(u(),a(`div`,Ve,[o(m(de),{modelValue:m(I),"onUpdate:modelValue":c[7]||=e=>s(I)?I.value=e:null,type:`text`,label:`Voice ID`,description:`Enter the voice ID for your custom voice`,placeholder:`Enter voice name (e.g., 'Rachel', 'Josh')`},null,8,[`modelValue`]),m(N)===`elevenlabs`?(u(),a(`div`,He,[c[26]||=n(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),g(n(`select`,{"onUpdate:modelValue":c[8]||=e=>s(P)?P.value=e:null,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`},c[25]||=[n(`option`,{value:`eleven_monolingual_v1`},` Monolingual v1 `,-1),n(`option`,{value:`eleven_multilingual_v1`},` Multilingual v1 `,-1),n(`option`,{value:`eleven_multilingual_v2`},` Multilingual v2 `,-1)],512),[[ae,m(P)]])])):i(``,!0),n(`div`,Ue,[o(m(y),{modelValue:m(L),"onUpdate:modelValue":c[9]||=e=>s(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])])):i(``,!0)])])):i(``,!0)]),n(`div`,We,[n(`div`,Ge,[n(`h2`,k,[n(`div`,Ke,[o(m(he)),n(`div`,null,p(m(b)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),n(`div`,qe,[o(m(v),{modelValue:K.value,"onUpdate:modelValue":c[10]||=e=>K.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),K.value?g((u(),a(`textarea`,{key:1,"onUpdate:modelValue":c[12]||=e=>J.value=e,placeholder:`Enter SSML text...`,border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-48":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"font-mono":``,"outline-none":``},null,512)),[[oe,J.value]]):(u(),r(m(fe),{key:0,modelValue:q.value,"onUpdate:modelValue":c[11]||=e=>q.value=e,"h-24":``,"w-full":``,placeholder:m(b)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`)},null,8,[`modelValue`,`placeholder`])),n(`div`,Je,[n(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,disabled:Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!m(F),class:te({"opacity-50 cursor-not-allowed":Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!m(F)}),bg:`neutral-700 dark:neutral-300`,onClick:tt},[n(`div`,Xe,[c[28]||=n(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),n(`span`,null,p(Y.value?m(b)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):m(b)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,Ye),X.value?(u(),a(`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:$},c[29]||=[n(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[n(`div`,{"i-solar:stop-circle-bold-duotone":``}),n(`span`,null,`Stop`)],-1)])):i(``,!0)]),X.value?(u(),a(`audio`,{key:2,ref_key:`audioPlayer`,ref:Z,src:X.value,controls:``,class:`mt-2 w-full`},null,8,Ze)):i(``,!0)])])])]),g((u(),a(`div`,Qe,c[30]||=[n(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)])),[[d]])],64)}}});typeof b==`function`&&b(A);var j=A;export{j as default}; \ No newline at end of file +import{Fragment as e,RouterLink as t,createBaseVNode as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createVNode as o,defineComponent as ee,isRef as s,normalizeClass as te,onMounted as c,onUnmounted as l,openBlock as u,ref as d,renderList as ne,resolveDirective as re,storeToRefs as f,toDisplayString as p,unref as m,useI18n as ie,vModelSelect as ae,vModelText as oe,watch as se,withCtx as h,withDirectives as g}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{generateSpeech as ce,useProvidersStore as le,useSpeechStore as ue}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import{Skeleton_default as _}from"./Button-DdtiAfEa.js";import{FieldCheckbox_default as v,FieldInput_default as de,FieldRange_default as y}from"./src-CmPNYgc5.js";import"./Basic-C8g-kAol.js";import{Textarea_default as fe}from"./Textarea-BIh0Stpi.js";import{RadioCardManySelect_default as pe,RadioCardSimple_default as me,TestDummyMarker_default as he,VoiceCardManySelect_default as ge}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as b}from"./route-block-CC3cgg4Q.js";const _e={flex:`~ col md:row gap-6`},ve={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`w-full md:w-[40%]`},ye={flex:`~ col gap-4`},be={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},xe={text:`neutral-400 dark:neutral-500`},Se={"max-w-full":``},Ce={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},we={key:1},Te={key:0},x={flex:`~ col gap-4`},S={class:`text-lg md:text-2xl`},C={text:`neutral-400 dark:neutral-400`},w={key:0,class:`flex items-center justify-center py-4`},T={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`},E={class:`flex flex-col`},D={class:`font-medium`},O={class:`text-sm text-red-600 dark:text-red-400`},Ee={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`},De={class:`flex flex-col`},Oe={class:`font-medium`},ke={class:`text-sm text-amber-600 dark:text-amber-400`},Ae={key:0},je={flex:`~ col gap-4`},Me={key:0},Ne={class:`flex flex-col gap-4`},Pe={flex:`~ row gap-4`},Fe={key:1,class:`space-y-6`},Ie={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`},Le={class:`flex flex-col`},Re={class:`text-sm text-red-600 dark:text-red-400`},ze={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`},Be={flex:`~ col gap-4`},Ve={key:4,class:`mt-2 space-y-6`},He={key:0},Ue={flex:`~ col gap-4`},We={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ge={"w-full":``,"rounded-xl":``},k={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`},qe={flex:`~ col gap-4`},Je={flex:`~ row`,"gap-4":``},Ye=[`disabled`],Xe={flex:`~ row`,"items-center":``,"gap-2":``},Ze=[`src`],Qe={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var A=ee({__name:`speech`,setup(ee){let{t:b}=ie(),A=le(),j=ue(),{configuredSpeechProvidersMetadata:M}=f(A),{activeSpeechProvider:N,activeSpeechModel:P,activeSpeechVoice:F,activeSpeechVoiceId:I,pitch:L,isLoadingSpeechProviderVoices:$e,supportsModelListing:et,providerModels:R,isLoadingActiveProviderModels:z,activeProviderModelError:B,modelSearchQuery:V,speechProviderError:H,ssmlEnabled:U,availableVoices:W}=f(j),G=d(``),K=d(!1),q=d(`Hello, my name is AI Assistant`),J=d(``),Y=d(!1),X=d(``),Z=d(null),Q=d(``);c(async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)}),se(N,async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)});async function tt(){if(!q.value.trim()&&!K.value||K.value&&!J.value.trim())return;if(!P.value){console.error(`No model selected`);return}if(!F.value){console.error(`No voice selected`);return}let e=A.getProviderInstance(N.value);if(!e){console.error(`Failed to initialize speech provider`);return}let t=A.getProviderConfig(N.value);Y.value=!0,Q.value=``;try{X.value&&$();let n=K.value?J.value:j.generateSSML(q.value,F.value,{...t,pitch:L.value}),r=await ce({...e.speech(P.value,t),input:n,voice:F.value.id});X.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{Z.value&&Z.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),Q.value=e instanceof Error?e.message:`An unknown error occurred`}finally{Y.value=!1}}function $(){Z.value&&(Z.value.pause(),Z.value.currentTime=0),X.value&&(URL.revokeObjectURL(X.value),X.value=``)}l(()=>{X.value&&URL.revokeObjectURL(X.value)});function nt(e){F.value={id:e,name:e,description:e,previewURL:e,languages:[{code:`en`,title:`English`}],provider:N.value,gender:`male`}}function rt(e){P.value=e}return(ee,c)=>{var l;let d=re(`motion`);return u(),a(e,null,[n(`div`,_e,[n(`div`,ve,[n(`div`,null,[n(`div`,ye,[n(`div`,null,[n(`h2`,be,p(m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.title`)),1),n(`div`,xe,[n(`span`,null,p(m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.description`)),1)])]),n(`div`,Se,[m(M).length>0?(u(),a(`fieldset`,Ce,[(u(!0),a(e,null,ne(m(M),e=>(u(),r(m(me),{id:e.id,key:e.id,modelValue:m(N),"onUpdate:modelValue":c[0]||=e=>s(N)?N.value=e:null,name:`speech-provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(u(),a(`div`,we,[o(m(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:h(()=>c[13]||=[n(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,{class:`flex flex-col`},[n(`span`,{class:`font-medium`},`No Speech Providers Configured`),n(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your speech providers`)],-1),n(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[13]})]))])]),n(`div`,null,[m(N)&&m(et)?(u(),a(`div`,Te,[n(`div`,x,[n(`div`,null,[n(`h2`,S,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),n(`div`,C,[n(`span`,null,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),m(z)?(u(),a(`div`,w,[c[14]||=n(`div`,{class:`mr-2 animate-spin`},[n(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),n(`span`,null,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):m(B)?(u(),a(`div`,T,[c[15]||=n(`div`,{"i-solar:close-circle-line-duotone":``,class:`text-2xl text-red-500 dark:text-red-400`},null,-1),n(`div`,E,[n(`span`,D,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`)),1),n(`span`,O,p(m(B)),1)])])):m(R).length===0&&!m(z)?(u(),a(`div`,Ee,[c[16]||=n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,De,[n(`span`,Oe,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1),n(`span`,ke,p(m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)])])):m(R).length>0?(u(),r(m(pe),{key:3,modelValue:m(P),"onUpdate:modelValue":c[1]||=e=>s(P)?P.value=e:null,"search-query":m(V),"onUpdate:searchQuery":c[2]||=e=>s(V)?V.value=e:null,items:m(R),searchable:!0,"search-placeholder":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:m(V)}),"search-results-text":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":m(b)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":rt},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`])):i(``,!0)])])):i(``,!0)])]),m(N)?(u(),a(`div`,Ae,[n(`div`,je,[c[27]||=n(`div`,null,[n(`h2`,{class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},` Voice Configuration `),n(`div`,{text:`neutral-400 dark:neutral-500`},[n(`span`,null,`Customize how your AI assistant speaks`)])],-1),m($e)?(u(),a(`div`,Me,[n(`div`,Ne,[o(m(_),{class:`w-full rounded-lg p-2.5 text-sm`},{default:h(()=>c[17]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[17]}),n(`div`,Pe,[o(m(_),{class:`w-full rounded-lg p-4 text-sm`},{default:h(()=>c[18]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[18]}),o(m(_),{class:`w-full rounded-lg p-4 text-sm`},{default:h(()=>c[19]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[19]}),o(m(_),{class:`w-full rounded-lg p-4 text-sm`},{default:h(()=>c[20]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[20]})]),o(m(_),{class:`w-full rounded-lg p-3 text-sm`},{default:h(()=>c[21]||=[n(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[21]})])])):m(W)[m(N)]&&m(W)[m(N)].length>0?(u(),a(`div`,Fe,[o(m(ge),{"search-query":G.value,"onUpdate:searchQuery":c[3]||=e=>G.value=e,"voice-id":m(I),"onUpdate:voiceId":c[4]||=e=>s(I)?I.value=e:null,voices:(l=m(W)[m(N)])?.map(e=>({id:e.id,name:e.name,description:e.description,previewURL:e.previewURL,customizable:!1})),searchable:!0,"search-placeholder":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder`),"search-no-results-title":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`),"search-no-results-description":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`),"search-results-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results`,{count:0,total:0}),"custom-input-placeholder":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder`),"expand-button-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_more`),"collapse-button-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_less`),"play-button-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample`),"pause-button-text":m(b)(`settings.pages.modules.speech.sections.section.provider-voice-selection.pause`),"onUpdate:customValue":nt},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`])])):m(H)?(u(),a(`div`,Ie,[c[23]||=n(`div`,{"i-solar:close-circle-line-duotone":``,class:`text-2xl text-red-500 dark:text-red-400`},null,-1),n(`div`,Le,[c[22]||=n(`span`,{class:`font-medium`},`Error loading voices`,-1),n(`span`,Re,p(m(H)),1)])])):(u(),a(`div`,ze,c[24]||=[n(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),n(`div`,{class:`flex flex-col`},[n(`span`,{class:`font-medium`},`No voices available`),n(`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)])),n(`div`,Be,[o(m(y),{modelValue:m(L),"onUpdate:modelValue":c[5]||=e=>s(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`]),o(m(v),{modelValue:m(U),"onUpdate:modelValue":c[6]||=e=>s(U)?U.value=e:null,label:`Enable SSML`,description:`Enable Speech Synthesis Markup Language for more control over speech output`},null,8,[`modelValue`])]),!m(W)[m(N)]||m(W)[m(N)].length===0?(u(),a(`div`,Ve,[o(m(de),{modelValue:m(I),"onUpdate:modelValue":c[7]||=e=>s(I)?I.value=e:null,type:`text`,label:`Voice ID`,description:`Enter the voice ID for your custom voice`,placeholder:`Enter voice name (e.g., 'Rachel', 'Josh')`},null,8,[`modelValue`]),m(N)===`elevenlabs`?(u(),a(`div`,He,[c[26]||=n(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),g(n(`select`,{"onUpdate:modelValue":c[8]||=e=>s(P)?P.value=e:null,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`},c[25]||=[n(`option`,{value:`eleven_monolingual_v1`},` Monolingual v1 `,-1),n(`option`,{value:`eleven_multilingual_v1`},` Multilingual v1 `,-1),n(`option`,{value:`eleven_multilingual_v2`},` Multilingual v2 `,-1)],512),[[ae,m(P)]])])):i(``,!0),n(`div`,Ue,[o(m(y),{modelValue:m(L),"onUpdate:modelValue":c[9]||=e=>s(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])])):i(``,!0)])])):i(``,!0)]),n(`div`,We,[n(`div`,Ge,[n(`h2`,k,[n(`div`,Ke,[o(m(he)),n(`div`,null,p(m(b)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),n(`div`,qe,[o(m(v),{modelValue:K.value,"onUpdate:modelValue":c[10]||=e=>K.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),K.value?g((u(),a(`textarea`,{key:1,"onUpdate:modelValue":c[12]||=e=>J.value=e,placeholder:`Enter SSML text...`,border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-48":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"font-mono":``,"outline-none":``},null,512)),[[oe,J.value]]):(u(),r(m(fe),{key:0,modelValue:q.value,"onUpdate:modelValue":c[11]||=e=>q.value=e,"h-24":``,"w-full":``,placeholder:m(b)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`)},null,8,[`modelValue`,`placeholder`])),n(`div`,Je,[n(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,disabled:Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!m(F),class:te({"opacity-50 cursor-not-allowed":Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!m(F)}),bg:`neutral-700 dark:neutral-300`,onClick:tt},[n(`div`,Xe,[c[28]||=n(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),n(`span`,null,p(Y.value?m(b)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):m(b)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,Ye),X.value?(u(),a(`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:$},c[29]||=[n(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[n(`div`,{"i-solar:stop-circle-bold-duotone":``}),n(`span`,null,`Stop`)],-1)])):i(``,!0)]),X.value?(u(),a(`audio`,{key:2,ref_key:`audioPlayer`,ref:Z,src:X.value,controls:``,class:`mt-2 w-full`},null,8,Ze)):i(``,!0)])])])]),g((u(),a(`div`,Qe,c[30]||=[n(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)])),[[d]])],64)}}});typeof b==`function`&&b(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/src-CX9nVT7I.js b/assets/src-CmPNYgc5.js similarity index 99% rename from assets/src-CX9nVT7I.js rename to assets/src-CmPNYgc5.js index d261d51db42211a7c0de13cda6cab27300e5b88f..710de9a401342eeab5d2263b7e75e50fbc9c2938 100644 --- a/assets/src-CX9nVT7I.js +++ b/assets/src-CmPNYgc5.js @@ -1 +1 @@ -import{Comment as e,Fragment as t,__plugin_vue_export_helper_default as n,cloneVNode as r,computed as i,createApp as a,createBaseVNode as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createTextVNode as u,createVNode as d,defineComponent as f,getCurrentInstance as p,guardReactiveProps as m,h,inject as g,mergeModels as _,mergeProps as v,nextTick as y,normalizeClass as b,normalizeProps as x,normalizeStyle as S,onMounted as C,openBlock as w,popScopeId as T,provide as E,pushScopeId as ee,ref as D,renderList as O,renderSlot as k,resolveComponent as A,resolveDirective as te,toDisplayString as j,toRefs as ne,toValue as re,unref as M,unrefElement$1 as ie,useModel as N,useVModel as ae,vModelDynamic as oe,vModelText as se,watch as ce,withCtx as P,withDirectives as F,withKeys as le,withModifiers as ue,withScopeId as de}from"./index-BSwg6FIo.js";const fe=[`top`,`right`,`bottom`,`left`],pe=[`start`,`end`],me=fe.reduce((e,t)=>e.concat(t,t+`-`+pe[0],t+`-`+pe[1]),[]),he=Math.min,I=Math.max,ge=Math.round,_e=Math.floor,ve=e=>({x:e,y:e}),ye={left:`right`,right:`left`,bottom:`top`,top:`bottom`},be={start:`end`,end:`start`};function xe(e,t,n){return I(e,he(t,n))}function L(e,t){return typeof e==`function`?e(t):e}function R(e){return e.split(`-`)[0]}function z(e){return e.split(`-`)[1]}function Se(e){return e===`x`?`y`:`x`}function Ce(e){return e===`y`?`height`:`width`}function B(e){return[`top`,`bottom`].includes(R(e))?`y`:`x`}function we(e){return Se(B(e))}function Te(e,t,n){n===void 0&&(n=!1);let r=z(e),i=we(e),a=Ce(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ae(o)),[o,Ae(o)]}function Ee(e){let t=Ae(e);return[De(e),t,De(t)]}function De(e){return e.replace(/start|end/g,e=>be[e])}function Oe(e,t,n){let r=[`left`,`right`],i=[`right`,`left`],a=[`top`,`bottom`],o=[`bottom`,`top`];switch(e){case`top`:case`bottom`:return n?t?i:r:t?r:i;case`left`:case`right`:return t?a:o;default:return[]}}function ke(e,t,n,r){let i=z(e),a=Oe(R(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(De)))),a}function Ae(e){return e.replace(/left|right|bottom|top/g,e=>ye[e])}function je(e){return{top:0,right:0,bottom:0,left:0,...e}}function Me(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:je(e)}function V(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ne(e,t,n){let{reference:r,floating:i}=e,a=B(t),o=we(t),s=Ce(o),c=R(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(z(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}const Pe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ne(l,r,c),f=r,p={},m=0;for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=L(e,t)||{};if(l==null)return{};let d=Me(u),f={x:n,y:r},p=we(i),m=Ce(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=he(d[_],T),ee=he(d[v],T),D=E,O=C-h[m]-ee,k=C/2-h[m]/2+w,A=xe(D,k,O),te=!c.arrow&&z(i)!=null&&k!==A&&a.reference[m]/2-(kz(t)===e),...n.filter(t=>z(t)!==e)]:n.filter(e=>R(e)===e);return r.filter(n=>e?z(n)===e||(t?De(n)!==n:!1):!0)}const Re=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){var n,r,i;let{rects:a,middlewareData:o,placement:s,platform:c,elements:l}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:f=me,autoAlignment:p=!0,...m}=L(e,t),h=d!==void 0||f===me?Le(d||null,p,f):f,g=await Fe(t,m),_=(n=o.autoPlacement)?.index||0,v=h[_];if(v==null)return{};let y=Te(v,a,await(c.isRTL==null?void 0:c.isRTL(l.floating)));if(s!==v)return{reset:{placement:h[0]}};let b=[g[R(v)],g[y[0]],g[y[1]]],x=[...(r=o.autoPlacement)?.overflows||[],{placement:v,overflows:b}],S=h[_+1];if(S)return{data:{index:_+1,overflows:x},reset:{placement:S}};let C=x.map(e=>{let t=z(e.placement);return[e.placement,t&&u?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),w=C.filter(e=>e[2].slice(0,z(e[0])?2:3).every(e=>e<=0)),T=(i=w[0])?.[0]||C[0][0];return T===s?{}:{data:{index:_+1,overflows:x},reset:{placement:T}}}}},ze=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n,r;let{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0,...g}=L(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let _=R(i),v=B(s),y=R(s)===s,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),x=f||(y||!h?[Ae(s)]:Ee(s)),S=m!==`none`;!f&&S&&x.push(...ke(s,h,m,b));let C=[s,...x],w=await Fe(t,g),T=[],E=(r=a.flip)?.overflows||[];if(u&&T.push(w[_]),d){let e=Te(i,o,b);T.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:i,overflows:T}],!T.every(e=>e<=0)){var ee,D;let e=((ee=a.flip)?.index||0)+1,t=C[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let n=(D=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?.placement;if(!n)switch(p){case`bestFit`:{var O;let e=(O=E.filter(e=>{if(S){let t=B(e.placement);return t===v||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?.[0];e&&(n=e);break}case`initialPlacement`:n=s;break}if(i!==n)return{reset:{placement:n}}}return{}}}};function Be(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ve(e){return fe.some(t=>e[t]>=0)}const He=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=L(e,t);switch(r){case`referenceHidden`:{let e=await Fe(t,{...i,elementContext:`reference`}),r=Be(e,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Ve(r)}}}case`escaped`:{let e=await Fe(t,{...i,altBoundary:!0}),r=Be(e,n.floating);return{data:{escapedOffsets:r,escaped:Ve(r)}}}default:return{}}}}};async function Ue(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=R(n),s=z(n),c=B(n)===`y`,l=[`left`,`top`].includes(o)?-1:1,u=a&&c?-1:1,d=L(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}const We=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n,r;let{x:i,y:a,placement:o,middlewareData:s}=t,c=await Ue(t,e);return o===(n=s.offset)?.placement&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},Ge=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=L(e,t),l={x:n,y:r},u=await Fe(t,c),d=B(R(i)),f=Se(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=xe(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=xe(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Ke=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=L(e,t),u={x:n,y:r},d=B(i),f=Se(d),p=u[f],m=u[d],h=L(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){var _,v;let e=f===`y`?`width`:`height`,t=[`top`,`left`].includes(R(i)),n=a.reference[d]-a.floating[e]+(t&&(_=o.offset)?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:(v=o.offset)?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},qe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=L(e,t),u=await Fe(t,l),d=R(i),f=z(i),p=B(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=he(h-u[g],v),x=he(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=I(u.left,0),t=I(u.right,0),n=I(u.top,0),r=I(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:I(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:I(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Je(e){return e?e.flatMap(e=>e.type===t?Je(e.children):[e]):[]}const Ye=f({name:`PrimitiveSlot`,inheritAttrs:!1,setup(t,{attrs:n,slots:i}){return()=>{var t;if(!i.default)return null;let a=Je(i.default()),o=a.findIndex(t=>t.type!==e);if(o===-1)return a;let s=a[o];(t=s.props)==null||delete t.ref;let c=s.props?v(n,s.props):n,l=r({...s,props:{}},c);return a.length===1?l:(a[o]=l,a)}}}),Xe=[`area`,`img`,`input`],Ze=f({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Xe.includes(r)?()=>h(r,t):r===`template`?()=>h(Ye,t,{default:n.default}):()=>h(e.as,t,{default:n.default})}}),Qe=f({__name:`VisuallyHidden`,props:{feature:{default:`focusable`},asChild:{type:Boolean},as:{default:`span`}},setup(e){return(e,t)=>(w(),s(M(Ze),{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:P(()=>[k(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}});function $e(e,t){let n=typeof e==`string`&&!t?`${e}Context`:t,r=Symbol(n),i=t=>{let n=g(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},a=e=>(E(r,e),e);return[i,a]}function et(){let e=p(),t=D(),n=i(()=>{var e,n;return[`#text`,`#comment`].includes((e=t.value)?.$el.nodeName)?(n=t.value)?.$el.nextElementSibling:ie(t)}),r=Object.assign({},e.exposed),a={};for(let t in e.props)Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(r).length>0)for(let e in r)Object.defineProperty(a,e,{enumerable:!0,configurable:!0,get:()=>r[e]});Object.defineProperty(a,`$el`,{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=a;function o(n){t.value=n,n&&(Object.defineProperty(a,`$el`,{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),e.exposed=a)}return{forwardRef:o,currentRef:t,currentElement:n}}function tt(){let e=D(),t=i(()=>{var t,n;return[`#text`,`#comment`].includes((t=e.value)?.$el.nodeName)?(n=e.value)?.$el.nextElementSibling:ie(e)});return{primitiveElement:e,currentElement:t}}function nt(e){return i(()=>{var t;return re(e)?!!(t=ie(e))?.closest(`form`):!0})}const rt=f({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=tt(),a=i(()=>t.checked??t.value);return ce(a,(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`),o=a.set;if(o&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});o.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(w(),s(Qe,v({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),it=f({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:`fully-hidden`}},setup(e){let n=e,r=i(()=>typeof n.value==`object`&&Array.isArray(n.value)&&n.value.length===0&&n.required),a=i(()=>typeof n.value==`string`||typeof n.value==`number`||typeof n.value==`boolean`?[{name:n.name,value:n.value}]:typeof n.value==`object`&&Array.isArray(n.value)?n.value.flatMap((e,t)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`[${n.name}][${t}][${e}]`,value:r})):{name:`[${n.name}][${t}]`,value:e}):n.value!==null&&typeof n.value==`object`&&!Array.isArray(n.value)?Object.entries(n.value).map(([e,t])=>({name:`[${n.name}][${e}]`,value:t})):[]);return(e,i)=>r.value?(w(),s(rt,v({key:e.name},{...n,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(w(!0),l(t,{key:1},O(a.value,t=>(w(),s(rt,v({key:t.name,ref_for:!0},{...n,...e.$attrs},{name:t.name,value:t.value}),null,16,[`name`,`value`]))),128))}}),[at,ot]=$e(`SwitchRoot`),st=f({__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(e,{emit:t}){let n=e,r=t,{disabled:a}=ne(n),o=ae(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function l(){a.value||(o.value=!o.value)}let{forwardRef:u,currentElement:d}=et(),f=nt(d),p=i(()=>{var e;return n.id&&d.value?(e=document.querySelector(`[for="${n.id}"]`))?.innerText:void 0});return ot({modelValue:o,toggleCheck:l,disabled:a}),(e,t)=>(w(),s(M(Ze),v(e.$attrs,{id:e.id,ref:M(u),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||p.value,"aria-checked":M(o),"aria-required":e.required,"data-state":M(o)?`checked`:`unchecked`,"data-disabled":M(a)?``:void 0,"as-child":e.asChild,as:e.as,disabled:M(a),onClick:l,onKeydown:le(ue(l,[`prevent`]),[`enter`])}),{default:P(()=>[k(e.$slots,`default`,{modelValue:M(o)}),M(f)&&e.name?(w(),s(M(it),{key:0,type:`checkbox`,name:e.name,disabled:M(a),required:e.required,value:e.value,checked:!!M(o)},null,8,[`name`,`disabled`,`required`,`value`,`checked`])):c(``,!0)]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]))}}),ct=f({__name:`SwitchThumb`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=at();return et(),(e,n)=>{var r;return w(),s(M(Ze),{"data-state":(r=M(t).modelValue)?.value?`checked`:`unchecked`,"data-disabled":M(t).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:P(()=>[k(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`])}}});var lt=f({__name:`Checkbox`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=N(e,`modelValue`);return(e,n)=>(w(),s(M(st),{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,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:P(()=>[d(M(ct),{"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`]))}}),ut=lt;const dt={flex:`~ col gap-4`},ft={flex:`~ row`,"items-center":``,"gap-2":``},pt={flex:`1`},mt={class:`flex items-center gap-1 text-sm font-medium`},ht={class:`text-xs text-neutral-500 dark:text-neutral-400`};var gt=f({__name:`FieldCheckbox`,props:_({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=N(e,`modelValue`);return(e,r)=>(w(),l(`label`,dt,[o(`div`,ft,[o(`div`,pt,[o(`div`,mt,j(t.label),1),o(`div`,ht,j(t.description),1)]),d(ut,{modelValue:n.value,"onUpdate:modelValue":r[0]||=e=>n.value=e},null,8,[`modelValue`])])]))}}),_t=gt;const vt=[`type`];var yt=f({__name:`Input`,props:_({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=N(e,`modelValue`);return(e,r)=>F((w(),l(`input`,{"onUpdate:modelValue":r[0]||=e=>n.value=e,type:t.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,vt)),[[oe,n.value]])}}),bt=yt;const xt={"max-w-full":``},St={flex:`~ col gap-4`},Ct={class:`flex items-center gap-1 text-sm font-medium`},wt={key:0,class:`text-red-500`},Tt={class:`text-xs text-neutral-500 dark:text-neutral-400`,"text-nowrap":``},Et=[`type`,`placeholder`];var Dt=f({__name:`FieldInput`,props:_({label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null,singleLine:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=N(e,`modelValue`);return(r,i)=>(w(),l(`div`,xt,[o(`label`,St,[o(`div`,null,[o(`div`,Ct,[u(j(t.label)+` `,1),t.required===!1?c(``,!0):(w(),l(`span`,wt,`*`))]),o(`div`,Tt,j(t.description),1)]),e.singleLine?(w(),s(bt,{key:0,modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,type:t.type,placeholder:t.placeholder,class:b(t.inputClass)},null,8,[`modelValue`,`type`,`placeholder`,`class`])):F((w(),l(`textarea`,{key:1,"onUpdate:modelValue":i[1]||=e=>n.value=e,type:t.type,placeholder:t.placeholder,class:b(t.inputClass),border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,10,Et)),[[se,n.value]])])]))}}),Ot=Dt;const kt={flex:`~ gap-2`};var At=f({__name:`InputKeyValue`,props:_({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:[`update:propertyKey`,`update:propertyValue`],setup(e){let t=e,n=N(e,`propertyKey`),r=N(e,`propertyValue`);return(e,i)=>(w(),l(`div`,kt,[d(bt,{modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,placeholder:t.keyPlaceholder,class:`w-1/2`},null,8,[`modelValue`,`placeholder`]),d(bt,{modelValue:r.value,"onUpdate:modelValue":i[1]||=e=>r.value=e,placeholder:t.valuePlaceholder,class:`w-1/2`},null,8,[`modelValue`,`placeholder`])]))}}),jt=At;const Mt={"max-w-full":``},Nt={flex:`~ col gap-2`},Pt={class:`flex items-center gap-1 text-sm font-medium`},Ft={key:0,class:`text-red-500`},It={class:`text-xs text-neutral-500 dark:text-neutral-400`,"text-nowrap":``},Lt={flex:`~ col gap-2`},Rt=[`onClick`];var zt=f({__name:`FieldKeyValues`,props:_({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:_([`remove`,`add`],[`update:modelValue`]),setup(e,{emit:n}){let r=e,i=n,a=N(e,`modelValue`),s=D(``),f=D(``);return ce([s,f],()=>{i(`add`,s.value,f.value)}),(e,n)=>{let s=te(`auto-animate`);return w(),l(`div`,Mt,[o(`label`,Nt,[o(`div`,null,[o(`div`,Pt,[u(j(r.label)+` `,1),r.required===!1?c(``,!0):(w(),l(`span`,Ft,`*`))]),o(`div`,It,j(r.description),1)]),F((w(),l(`div`,Lt,[(w(!0),l(t,null,O(a.value,(e,t)=>(w(),l(`div`,{key:t,"w-full":``,flex:``,"items-center":``,"gap-2":``},[d(jt,{"property-key":e.key,"onUpdate:propertyKey":t=>e.key=t,"property-value":e.value,"onUpdate:propertyValue":t=>e.value=t,"key-placeholder":r.keyPlaceholder,"value-placeholder":r.valuePlaceholder,"w-full":``},null,8,[`property-key`,`onUpdate:propertyKey`,`property-value`,`onUpdate:propertyValue`,`key-placeholder`,`value-placeholder`]),o(`button`,{onClick:e=>i(`remove`,t)},n[0]||=[o(`div`,{"i-solar:minus-circle-line-duotone":``,size:`6`},null,-1)],8,Rt)]))),128))])),[[s]])])])}}}),Bt=zt;const Vt=[`min`,`max`,`step`];var Ht=f({__name:`Range`,props:_({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(e){let t=e,n=N(e,`modelValue`),r=i(()=>t.min*1e4),a=i(()=>t.max*1e4),o=i(()=>t.step*1e4),s=D(),c=i({get:()=>n.value*1e4,set:e=>{n.value=e/1e4,u()}});C(()=>{u()});function u(){s.value&&(s.value.style.setProperty(`--value`,s.value.value),s.value.style.setProperty(`--min`,s.value.min?s.value.min:t.min.toString()),s.value.style.setProperty(`--max`,s.value.max?s.value.max:t.max.toString()))}function d(e){let t=e.target;t.style.setProperty(`--value`,t.value)}return(e,t)=>F((w(),l(`input`,{ref_key:`sliderRef`,ref:s,"onUpdate:modelValue":t[0]||=e=>c.value=e,type:`range`,min:r.value,max:a.value,step:o.value,class:`slider-progress form_input-range`,onInput:d},null,40,Vt)),[[se,c.value,void 0,{number:!0}]])}}),Ut=n(Ht,[[`__scopeId`,`data-v-c59a94f0`]]);const Wt={flex:`~ col gap-4`},Gt={flex:`~ row`,"items-center":``,"gap-2":``},Kt={flex:`1`},qt={class:`flex items-center gap-1 text-sm font-medium`},Jt={class:`text-xs text-neutral-500 dark:text-neutral-400`},Yt={"font-mono":``},Xt={flex:`~ row`,"items-center":``,"gap-2":``};var Zt=f({__name:`FieldRange`,props:_({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=N(e,`modelValue`);return(r,i)=>{var a;return w(),l(`label`,Wt,[o(`div`,Gt,[o(`div`,Kt,[o(`div`,qt,j(e.label),1),o(`div`,Jt,j(e.description),1)]),o(`span`,Yt,j((a=t.formatValue)?.call(t,n.value)||n.value),1)]),o(`div`,Xt,[d(Ut,{modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,min:e.min||0,max:e.max||1,step:e.step||.01,"w-full":``},null,8,[`modelValue`,`min`,`max`,`step`])])])}}}),Qt=Zt;const $t={class:`max-w-full`},en={class:`flex flex-col gap-2`},tn={class:`flex items-center gap-1 text-sm font-medium`},nn={key:0,class:`text-red-500`},rn={class:`text-nowrap text-xs text-neutral-500 dark:text-neutral-400`},an={class:`~ col gap-2`},on=[`onClick`];var sn=f({__name:`FieldValues`,props:_({label:null,description:null,name:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:_([`remove`,`add`],[`update:modelValue`]),setup(e,{emit:n}){let r=e,i=n,a=N(e,`modelValue`);function s(){a.value.push(``),i(`add`)}function f(e){a.value.splice(e,1),i(`remove`,e)}return(e,n)=>{let i=te(`auto-animate`);return w(),l(`div`,$t,[o(`label`,en,[o(`div`,null,[o(`div`,tn,[u(j(r.label)+` `,1),r.required===!1?c(``,!0):(w(),l(`span`,nn,`*`))]),o(`div`,rn,j(r.description),1)]),F((w(),l(`div`,an,[(w(!0),l(t,null,O(a.value,(e,t)=>(w(),l(`div`,{key:t,class:`w-full flex items-center gap-2`},[d(bt,{modelValue:a.value[t],"onUpdate:modelValue":e=>a.value[t]=e,placeholder:r.valuePlaceholder,class:`w-90%`},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`]),o(`button`,{"i-solar:minus-circle-line-duotone":``,size:`6`,class:`min-w-20px w-10% flex text-red-500`,onClick:e=>f(t)},null,8,on)]))),128)),o(`div`,{"i-solar:add-circle-line-duotone":``,size:`6`,class:`mt-2 w-4/5 text-blue-500`,onClick:s})])),[[i]])])])}}}),cn=sn;const ln=[`disabled`];var un=f({__name:`ColorHueRange`,props:_({disabled:{type:Boolean},class:null},{colorValue:{type:String,default:``},colorValueModifiers:{}}),emits:[`update:colorValue`],setup(e){let t=e,n=N(e,`colorValue`);return(e,r)=>F((w(),l(`input`,{"onUpdate:modelValue":r[0]||=e=>n.value=e,type:`range`,min:`0`,max:`360`,step:`0.01`,class:b([`color-hue-range`,[t.disabled?`opacity-25 cursor-not-allowed`:`cursor-pointer`,t.class||``]]),transition:`all ease-in-out duration-250`,disabled:t.disabled},null,10,ln)),[[se,n.value]])}}),dn=n(un,[[`__scopeId`,`data-v-ae80cb9d`]]);function H(e){var t;return(t=e.ownerDocument)?.defaultView||window}function U(e){return H(e).getComputedStyle(e)}const fn=Math.min,pn=Math.max,mn=Math.round;function hn(e){let t=U(e),n=parseFloat(t.width),r=parseFloat(t.height),i=e.offsetWidth,a=e.offsetHeight,o=mn(n)!==i||mn(r)!==a;return o&&(n=i,r=a),{width:n,height:r,fallback:o}}function W(e){return vn(e)?(e.nodeName||``).toLowerCase():``}let gn;function _n(){if(gn)return gn;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(gn=e.brands.map(e=>e.brand+`/`+e.version).join(` `),gn):navigator.userAgent}function G(e){return e instanceof H(e).HTMLElement}function K(e){return e instanceof H(e).Element}function vn(e){return e instanceof H(e).Node}function yn(e){return typeof ShadowRoot>`u`?!1:e instanceof H(e).ShadowRoot||e instanceof ShadowRoot}function bn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function xn(e){return[`table`,`td`,`th`].includes(W(e))}function Sn(e){let t=/firefox/i.test(_n()),n=U(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!==`none`||n.perspective!==`none`||!!r&&r!==`none`||t&&n.willChange===`filter`||t&&!!n.filter&&n.filter!==`none`||[`transform`,`perspective`].some(e=>n.willChange.includes(e))||[`paint`,`layout`,`strict`,`content`].some(e=>{let t=n.contain;return t!=null&&t.includes(e)})}function Cn(){return!/^((?!chrome|android).)*safari/i.test(_n())}function wn(e){return[`html`,`body`,`#document`].includes(W(e))}function Tn(e){return K(e)?e:e.contextElement}const En={x:1,y:1};function Dn(e){let t=Tn(e);if(!G(t))return En;let n=t.getBoundingClientRect(),{width:r,height:i,fallback:a}=hn(t),o=(a?mn(n.width):n.width)/r,s=(a?mn(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}function On(e,t,n,r){var i,a;t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),s=Tn(e),c=En;t&&(r?K(r)&&(c=Dn(r)):c=Dn(e));let l=s?H(s):window,u=!Cn()&&n,d=(o.left+(u&&(i=l.visualViewport)?.offsetLeft||0))/c.x,f=(o.top+(u&&(a=l.visualViewport)?.offsetTop||0))/c.y,p=o.width/c.x,m=o.height/c.y;if(s){let e=H(s),t=r&&K(r)?H(r):r,n=e.frameElement;for(;n&&r&&t!==e;){let e=Dn(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,f*=e.y,p*=e.x,m*=e.y,d+=t.x,f+=t.y,n=H(n).frameElement}}return{width:p,height:m,top:f,right:d+p,bottom:f+m,left:d,x:d,y:f}}function q(e){return((vn(e)?e.ownerDocument:e.document)||window.document).documentElement}function kn(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function An(e){return On(q(e)).left+kn(e).scrollLeft}function jn(e){if(W(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||yn(e)&&e.host||q(e);return yn(t)?t.host:t}function Mn(e){let t=jn(e);return wn(t)?t.ownerDocument.body:G(t)&&bn(t)?t:Mn(t)}function Nn(e,t){var n;t===void 0&&(t=[]);let r=Mn(e),i=r===(n=e.ownerDocument)?.body,a=H(r);return i?t.concat(a,a.visualViewport||[],bn(r)?r:[]):t.concat(r,Nn(r))}function Pn(e,t,n){return t===`viewport`?V(function(e,t){let n=H(e),r=q(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Cn();(e||!e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}(e,n)):K(t)?V(function(e,t){let n=On(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=G(e)?Dn(e):{x:1,y:1};return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n)):V(function(e){let t=q(e),n=kn(e),r=e.ownerDocument.body,i=pn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=pn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+An(e),s=-n.scrollTop;return U(r).direction===`rtl`&&(o+=pn(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(q(e)))}function Fn(e){return G(e)&&U(e).position!==`fixed`?e.offsetParent:null}function In(e){let t=H(e),n=Fn(e);for(;n&&xn(n)&&U(n).position===`static`;)n=Fn(n);return n&&(W(n)===`html`||W(n)===`body`&&U(n).position===`static`&&!Sn(n))?t:n||function(e){let t=jn(e);for(;G(t)&&!wn(t);){if(Sn(t))return t;t=jn(t)}return null}(e)||t}function Ln(e,t,n){let r=G(t),i=q(t),a=On(e,!0,n===`fixed`,t),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&n!==`fixed`)if((W(t)!==`body`||bn(i))&&(o=kn(t)),G(t)){let e=On(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=An(i));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}const Rn={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=n===`clippingAncestors`?function(e,t){let n=t.get(e);if(n)return n;let r=Nn(e).filter(e=>K(e)&&W(e)!==`body`),i=null,a=U(e).position===`fixed`,o=a?jn(e):e;for(;K(o)&&!wn(o);){let e=U(o),t=Sn(o);(a?t||i:t||e.position!==`static`||!i||![`absolute`,`fixed`].includes(i.position))?i=e:r=r.filter(e=>e!==o),o=jn(o)}return t.set(e,r),r}(t,this._c):[].concat(n),o=[...a,r],s=o[0],c=o.reduce((e,n)=>{let r=Pn(t,n,i);return e.top=pn(r.top,e.top),e.right=fn(r.right,e.right),e.bottom=fn(r.bottom,e.bottom),e.left=pn(r.left,e.left),e},Pn(t,s,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=G(n),a=q(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((i||!i&&r!==`fixed`)&&((W(n)!==`body`||bn(a))&&(o=kn(n)),G(n))){let e=On(n);s=Dn(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-o.scrollLeft*s.x+c.x,y:t.y*s.y-o.scrollTop*s.y+c.y}},isElement:K,getDimensions:function(e){return G(e)?hn(e):e.getBoundingClientRect()},getOffsetParent:In,getDocumentElement:q,getScale:Dn,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e,i=this.getOffsetParent||In,a=this.getDimensions;return{reference:Ln(t,await i(n),r),floating:{x:0,y:0,...await a(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>U(e).direction===`rtl`},zn=(e,t,n)=>{let r=new Map,i={platform:Rn,...n},a={...i.platform,_c:r};return Pe(e,t,{...i,platform:a})},J={disabled:!1,distance:5,skidding:0,container:`body`,boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:`absolute`,preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:`top`,triggers:[`hover`,`focus`,`touch`],hideTriggers:e=>[...e,`click`],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:`...`},dropdown:{placement:`bottom`,triggers:[`click`],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:`dropdown`,triggers:[`hover`,`focus`],popperTriggers:[`hover`],delay:{show:0,hide:400}}}};function Bn(e,t){let n=J.themes[e]||{},r;do r=n[t],typeof r>`u`?n.$extend?n=J.themes[n.$extend]||{}:(n=null,r=J[t]):n=null;while(n);return r}function Vn(e){let t=[e],n=J.themes[e]||{};do n.$extend&&!n.$resetCss?(t.push(n.$extend),n=J.themes[n.$extend]||{}):n=null;while(n);return t.map(e=>`v-popper--theme-${e}`)}function Hn(e){let t=[e],n=J.themes[e]||{};do n.$extend?(t.push(n.$extend),n=J.themes[n.$extend]||{}):n=null;while(n);return t}let Un=!1;if(typeof window<`u`){Un=!1;try{let e=Object.defineProperty({},`passive`,{get(){Un=!0}});window.addEventListener(`test`,null,e)}catch{}}let Wn=!1;typeof window<`u`&&typeof navigator<`u`&&(Wn=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const Gn=[`auto`,`top`,`bottom`,`left`,`right`].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),Kn={hover:`mouseenter`,focus:`focus`,click:`click`,touch:`touchstart`,pointer:`pointerdown`},qn={hover:`mouseleave`,focus:`blur`,click:`click`,touch:`touchend`,pointer:`pointerup`};function Jn(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}function Yn(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const Y=[];let X=null;const Xn={};function Zn(e){let t=Xn[e];return t||=Xn[e]=[],t}let Qn=function(){};typeof window<`u`&&(Qn=window.Element);function Z(e){return function(t){return Bn(t.theme,e)}}const $n=`__floating-vue__popper`,er=()=>f({name:`VPopper`,provide(){return{[$n]:{parentPopper:this}}},inject:{[$n]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:Z(`disabled`)},positioningDisabled:{type:Boolean,default:Z(`positioningDisabled`)},placement:{type:String,default:Z(`placement`),validator:e=>Gn.includes(e)},delay:{type:[String,Number,Object],default:Z(`delay`)},distance:{type:[Number,String],default:Z(`distance`)},skidding:{type:[Number,String],default:Z(`skidding`)},triggers:{type:Array,default:Z(`triggers`)},showTriggers:{type:[Array,Function],default:Z(`showTriggers`)},hideTriggers:{type:[Array,Function],default:Z(`hideTriggers`)},popperTriggers:{type:Array,default:Z(`popperTriggers`)},popperShowTriggers:{type:[Array,Function],default:Z(`popperShowTriggers`)},popperHideTriggers:{type:[Array,Function],default:Z(`popperHideTriggers`)},container:{type:[String,Object,Qn,Boolean],default:Z(`container`)},boundary:{type:[String,Qn],default:Z(`boundary`)},strategy:{type:String,validator:e=>[`absolute`,`fixed`].includes(e),default:Z(`strategy`)},autoHide:{type:[Boolean,Function],default:Z(`autoHide`)},handleResize:{type:Boolean,default:Z(`handleResize`)},instantMove:{type:Boolean,default:Z(`instantMove`)},eagerMount:{type:Boolean,default:Z(`eagerMount`)},popperClass:{type:[String,Array,Object],default:Z(`popperClass`)},computeTransformOrigin:{type:Boolean,default:Z(`computeTransformOrigin`)},autoMinSize:{type:Boolean,default:Z(`autoMinSize`)},autoSize:{type:[Boolean,String],default:Z(`autoSize`)},autoMaxSize:{type:Boolean,default:Z(`autoMaxSize`)},autoBoundaryMaxSize:{type:Boolean,default:Z(`autoBoundaryMaxSize`)},preventOverflow:{type:Boolean,default:Z(`preventOverflow`)},overflowPadding:{type:[Number,String],default:Z(`overflowPadding`)},arrowPadding:{type:[Number,String],default:Z(`arrowPadding`)},arrowOverflow:{type:Boolean,default:Z(`arrowOverflow`)},flip:{type:Boolean,default:Z(`flip`)},shift:{type:Boolean,default:Z(`shift`)},shiftCrossAxis:{type:Boolean,default:Z(`shiftCrossAxis`)},noAutoFocus:{type:Boolean,default:Z(`noAutoFocus`)},disposeTimeout:{type:Number,default:Z(`disposeTimeout`)}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:``,strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join(`_`)}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId==null?this.randomId:this.ariaId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide==`function`?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[$n])?.parentPopper},hasPopperShowTriggerHover(){var e,t;return(e=this.popperTriggers)?.includes(`hover`)||(t=this.popperShowTriggers)?.includes(`hover`)}},watch:{shown:`$_autoShowHide`,disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:`$_refreshListeners`,deep:!0},positioningDisabled:`$_refreshListeners`,...[`placement`,`distance`,`skidding`,`boundary`,`strategy`,`overflowPadding`,`arrowPadding`,`preventOverflow`,`shift`,`shiftCrossAxis`,`flip`].reduce((e,t)=>(e[t]=`$_computePosition`,e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:n=!1}={}){var r,i;(r=this.parentPopper)!=null&&r.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(n||!this.disabled)&&((i=this.parentPopper)?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit(`show`),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit(`update:shown`,!0))},hide({event:e=null,skipDelay:t=!1}={}){var n;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}(n=this.parentPopper)?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit(`hide`),this.$emit(`update:shown`,!1)}},init(){var e;this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=(e=this.referenceNode)?.call(this)??this.$el,this.$_targetNodes=this.targetNodes().filter(e=>e.nodeType===e.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(`.v-popper__inner`),this.$_arrowNode=this.$_popperNode.querySelector(`.v-popper__arrow-container`),this.$_swapTargetAttrs(`title`,`data-original-title`),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs(`data-original-title`,`title`))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit(`resize`))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;let e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(We({mainAxis:this.distance,crossAxis:this.skidding}));let t=this.placement.startsWith(`auto`);if(t?e.middleware.push(Re({alignment:this.placement.split(`-`)[1]??``})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(Ge({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(ze({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(Ie({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:`arrowOverflow`,fn:({placement:e,rects:t,middlewareData:n})=>{let r,{centerOffset:i}=n.arrow;return r=e.startsWith(`top`)||e.startsWith(`bottom`)?Math.abs(i)>t.reference.width/2:Math.abs(i)>t.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){let t=this.autoSize?this.autoSize:this.autoMinSize?`min`:null;e.middleware.push({name:`autoSize`,fn:({rects:e,placement:n,middlewareData:r})=>{var i;if((i=r.autoSize)!=null&&i.skip)return{};let a,o;return n.startsWith(`top`)||n.startsWith(`bottom`)?a=e.reference.width:o=e.reference.height,this.$_innerNode.style[t===`min`?`minWidth`:t===`max`?`maxWidth`:`width`]=a==null?null:`${a}px`,this.$_innerNode.style[t===`min`?`minHeight`:t===`max`?`maxHeight`:`height`]=o==null?null:`${o}px`,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(qe({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:e,availableHeight:t})=>{this.$_innerNode.style.maxWidth=e==null?null:`${e}px`,this.$_innerNode.style.maxHeight=t==null?null:`${t}px`}})));let n=await zn(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:n.x,y:n.y,placement:n.placement,strategy:n.strategy,arrow:{...n.middlewareData.arrow,...n.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),X&&this.instantMove&&X.instantMove&&X!==this.parentPopper){X.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay(`show`))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(X=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay(`hide`))},$_computeDelay(e){let t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await Yn(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...Nn(this.$_referenceNode),...Nn(this.$_popperNode)],`scroll`,()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){let e=this.$_referenceNode.getBoundingClientRect(),t=this.$_popperNode.querySelector(`.v-popper__wrapper`),n=t.parentNode.getBoundingClientRect(),r=e.x+e.width/2-(n.left+t.offsetLeft),i=e.y+e.height/2-(n.top+t.offsetTop);this.result.transformOrigin=`${r}px ${i}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":``});let e=this.showGroup;if(e){let t;for(let n=0;n0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,Jn(Y,this),Y.length===0&&document.body.classList.remove(`v-popper--some-open`);for(let e of Hn(this.theme)){let t=Zn(e);Jn(t,this),t.length===0&&document.body.classList.remove(`v-popper--some-open--${e}`)}X===this&&(X=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);let t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners(`scroll`),this.$emit(`apply-hide`),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await Yn(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e==`string`?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw Error(`No container for popover: `+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){let e=e=>{this.isShown&&!this.$_hideInProgress||(e.usedByTooltip=!0,!this.$_preventShow&&this.show({event:e}))};this.$_registerTriggerListeners(this.$_targetNodes,Kn,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],Kn,this.popperTriggers,this.popperShowTriggers,e);let t=e=>{e.usedByTooltip||this.hide({event:e})};this.$_registerTriggerListeners(this.$_targetNodes,qn,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],qn,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,n){this.$_events.push({targetNodes:e,eventType:t,handler:n}),e.forEach(e=>e.addEventListener(t,n,Un?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,n,r,i){let a=n;r!=null&&(a=typeof r==`function`?r(a):r),a.forEach(n=>{let r=t[n];r&&this.$_registerEventListeners(e,r,i)})},$_removeEventListeners(e){let t=[];this.$_events.forEach(n=>{let{targetNodes:r,eventType:i,handler:a}=n;!e||e===i?r.forEach(e=>e.removeEventListener(i,a)):t.push(n)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit(`close-directive`):this.$emit(`auto-hide`),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(let n of this.$_targetNodes){let r=n.getAttribute(e);r&&(n.removeAttribute(e),n.setAttribute(t,r))}},$_applyAttrsToTarget(e){for(let t of this.$_targetNodes)for(let n in e){let r=e[n];r==null?t.removeAttribute(n):t.setAttribute(n,r)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){let e=this.$_referenceNode.getBoundingClientRect();if(sr>=e.left&&sr<=e.right&&cr>=e.top&&cr<=e.bottom){let e=this.$_popperNode.getBoundingClientRect(),t=sr-Q,n=cr-$,r=e.left+e.width/2-Q+(e.top+e.height/2)-$+e.width+e.height,i=Q+t*r,a=$+n*r;return lr(Q,$,i,a,e.left,e.top,e.left,e.bottom)||lr(Q,$,i,a,e.left,e.top,e.right,e.top)||lr(Q,$,i,a,e.right,e.top,e.right,e.bottom)||lr(Q,$,i,a,e.left,e.bottom,e.right,e.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<`u`&&typeof window<`u`){if(Wn){let e=Un?{passive:!0,capture:!0}:!0;document.addEventListener(`touchstart`,e=>tr(e,!0),e),document.addEventListener(`touchend`,e=>nr(e,!0),e)}else window.addEventListener(`mousedown`,e=>tr(e,!1),!0),window.addEventListener(`click`,e=>nr(e,!1),!0);window.addEventListener(`resize`,or)}function tr(e,t){if(J.autoHideOnMousedown)rr(e,t);else for(let t=0;t=0;r--){let i=Y[r];try{let r=i.containsGlobalTarget=i.mouseDownContains||i.popperNode().contains(e.target);i.pendingHide=!1,requestAnimationFrame(()=>{if(i.pendingHide=!1,!n[i.randomId]&&ir(i,r,e)){if(i.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&r){let e=i.parentPopper;for(;e;)n[e.randomId]=!0,e=e.parentPopper;return}let a=i.parentPopper;for(;a&&ir(a,a.containsGlobalTarget,e);)a.$_handleGlobalClose(e,t),a=a.parentPopper}})}catch{}}}function ir(e,t,n){return n.closeAllPopover||n.closePopover&&t||ar(e,n)&&!t}function ar(e,t){if(typeof e.autoHide==`function`){let n=e.autoHide(t);return e.lastAutoHide=n,n}return e.autoHide}function or(){for(let e=0;e{Q=sr,$=cr,sr=e.clientX,cr=e.clientY},Un?{passive:!0}:void 0);function lr(e,t,n,r,i,a,o,s){let c=((o-i)*(t-a)-(s-a)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t)),l=((n-e)*(t-a)-(r-t)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t));return c>=0&&c<=1&&l>=0&&l<=1}const ur={extends:er()},dr=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};function fr(e,t,n,r,i,a){return w(),l(`div`,{ref:`reference`,class:b([`v-popper`,{"v-popper--shown":e.slotData.isShown}])},[k(e.$slots,`default`,x(m(e.slotData)))],2)}const pr=dr(ur,[[`render`,fr]]);function mr(){var e=window.navigator.userAgent,t=e.indexOf(`MSIE `);if(t>0)return parseInt(e.substring(t+5,e.indexOf(`.`,t)),10);var n=e.indexOf(`Trident/`);if(n>0){var r=e.indexOf(`rv:`);return parseInt(e.substring(r+3,e.indexOf(`.`,r)),10)}var i=e.indexOf(`Edge/`);return i>0?parseInt(e.substring(i+5,e.indexOf(`.`,i)),10):-1}let hr;function gr(){gr.init||(gr.init=!0,hr=mr()!==-1)}var _r={name:`ResizeObserver`,props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:[`notify`],mounted(){gr(),y(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});let e=document.createElement(`object`);this._resizeObject=e,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`tabindex`,-1),e.onload=this.addResizeHandlers,e.type=`text/html`,hr&&this.$el.appendChild(e),e.data=`about:blank`,hr||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit(`notify`,{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener(`resize`,this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!hr&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener(`resize`,this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const vr=de(`data-v-b329ee4c`);ee(`data-v-b329ee4c`);const yr={class:`resize-observer`,tabindex:`-1`};T();const br=vr((e,t,n,r,i,a)=>(w(),s(`div`,yr)));_r.render=br,_r.__scopeId=`data-v-b329ee4c`,_r.__file=`src/components/ResizeObserver.vue`;const xr=(e=`theme`)=>({computed:{themeClass(){return Vn(this[e])}}}),Sr=f({name:`VPopperContent`,components:{ResizeObserver:_r},mixins:[xr()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:[`hide`,`resize`],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),Cr=[`id`,`aria-hidden`,`tabindex`,`data-popper-placement`],wr={ref:`inner`,class:`v-popper__inner`},Tr=o(`div`,{class:`v-popper__arrow-outer`},null,-1),Er=o(`div`,{class:`v-popper__arrow-inner`},null,-1),Dr=[Tr,Er];function Or(e,n,r,i,a,u){let d=A(`ResizeObserver`);return w(),l(`div`,{id:e.popperId,ref:`popover`,class:b([`v-popper__popper`,[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:S(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?`false`:`true`,tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:n[2]||=le(t=>e.autoHide&&e.$emit(`hide`),[`esc`])},[o(`div`,{class:`v-popper__backdrop`,onClick:n[0]||=t=>e.autoHide&&e.$emit(`hide`)}),o(`div`,{class:`v-popper__wrapper`,style:S(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[o(`div`,wr,[e.mounted?(w(),l(t,{key:0},[o(`div`,null,[k(e.$slots,`default`)]),e.handleResize?(w(),s(d,{key:0,onNotify:n[1]||=t=>e.$emit(`resize`,t)})):c(``,!0)],64)):c(``,!0)],512),o(`div`,{ref:`arrow`,class:`v-popper__arrow-container`,style:S(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Dr,4)],4)],46,Cr)}const kr=dr(Sr,[[`render`,Or]]),Ar={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}};let jr=function(){};typeof window<`u`&&(jr=window.Element);const Mr=f({name:`VPopperWrapper`,components:{Popper:pr,PopperContent:kr},mixins:[Ar,xr(`finalTheme`)],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,jr,Boolean],default:void 0},boundary:{type:[String,jr],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function Nr(e,t,n,r,i,a){let o=A(`PopperContent`),c=A(`Popper`);return w(),s(c,v({ref:`popper`},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||=()=>e.$emit(`show`),onHide:t[1]||=()=>e.$emit(`hide`),"onUpdate:shown":t[2]||=t=>e.$emit(`update:shown`,t),onApplyShow:t[3]||=()=>e.$emit(`apply-show`),onApplyHide:t[4]||=()=>e.$emit(`apply-hide`),onCloseGroup:t[5]||=()=>e.$emit(`close-group`),onCloseDirective:t[6]||=()=>e.$emit(`close-directive`),onAutoHide:t[7]||=()=>e.$emit(`auto-hide`),onResize:t[8]||=()=>e.$emit(`resize`)}),{default:P(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,show:s,hide:c,handleResize:l,onResize:u,classes:f,result:p})=>[k(e.$slots,`default`,{shown:n,show:s,hide:c}),d(o,{ref:`popperContent`,"popper-id":t,theme:e.finalTheme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":l,classes:f,result:p,onHide:c,onResize:u},{default:P(()=>[k(e.$slots,`popper`,{shown:n,hide:c})]),_:2},1032,[`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:3},16,[`theme`,`target-nodes`,`popper-node`,`class`])}const Pr=dr(Mr,[[`render`,Nr]]),Fr={...Pr,name:`VDropdown`,vPopperTheme:`dropdown`},Ir={...Pr,name:`VMenu`,vPopperTheme:`menu`},Lr={...Pr,name:`VTooltip`,vPopperTheme:`tooltip`},Rr=f({name:`VTooltipDirective`,components:{Popper:er(),PopperContent:kr},mixins:[Ar],inheritAttrs:!1,props:{theme:{type:String,default:`tooltip`},html:{type:Boolean,default:e=>Bn(e.theme,`html`)},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>Bn(e.theme,`loadingContent`)},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content==`function`},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content==`function`&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;let e=++this.$_fetchId,t=this.content(this);t.then?t.then(t=>this.onResult(e,t)):this.onResult(e,t)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),zr=[`innerHTML`],Br=[`textContent`];function Vr(e,t,n,r,i,a){let o=A(`PopperContent`),c=A(`Popper`);return w(),s(c,v({ref:`popper`},e.$attrs,{theme:e.theme,"target-nodes":e.targetNodes,"popper-node":()=>e.$refs.popperContent.$el,onApplyShow:e.onShow,onApplyHide:e.onHide}),{default:P(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,hide:s,handleResize:c,onResize:u,classes:f,result:p})=>[d(o,{ref:`popperContent`,class:b({"v-popper--tooltip-loading":e.loading}),"popper-id":t,theme:e.theme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":c,classes:f,result:p,onHide:s,onResize:u},{default:P(()=>[e.html?(w(),l(`div`,{key:0,innerHTML:e.finalContent},null,8,zr)):(w(),l(`div`,{key:1,textContent:j(e.finalContent)},null,8,Br))]),_:2},1032,[`class`,`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:1},16,[`theme`,`target-nodes`,`popper-node`,`onApplyShow`,`onApplyHide`])}const Hr=dr(Rr,[[`render`,Vr]]),Ur=`v-popper--has-tooltip`;function Wr(e,t){let n=e.placement;if(!n&&t)for(let e of Gn)t[e]&&(n=e);return n||=Bn(e.theme||`tooltip`,`placement`),n}function Gr(e,t,n){let r,i=typeof t;return r=i===`string`?{content:t}:t&&i===`object`?t:{content:!1},r.placement=Wr(r,n),r.targetNodes=()=>[e],r.referenceNode=()=>e,r}let Kr,qr,Jr=0;function Yr(){if(Kr)return;qr=D([]),Kr=a({name:`VTooltipDirectiveApp`,setup(){return{directives:qr}},render(){return this.directives.map(e=>h(Hr,{...e.options,shown:e.shown||e.options.shown,key:e.id}))},devtools:{hide:!0}});let e=document.createElement(`div`);document.body.appendChild(e),Kr.mount(e)}function Xr(e,t,n){Yr();let r=D(Gr(e,t,n)),i=D(!1),a={id:Jr++,options:r,shown:i};return qr.value.push(a),e.classList&&e.classList.add(Ur),e.$_popper={options:r,item:a,show(){i.value=!0},hide(){i.value=!1}}}function Zr(e){if(e.$_popper){let t=qr.value.indexOf(e.$_popper.item);t!==-1&&qr.value.splice(t,1),delete e.$_popper,delete e.$_popperOldShown,delete e.$_popperMountTarget}e.classList&&e.classList.remove(Ur)}function Qr(e,{value:t,modifiers:n}){let r=Gr(e,t,n);if(!r.content||Bn(r.theme||`tooltip`,`disabled`))Zr(e);else{let i;e.$_popper?(i=e.$_popper,i.options.value=r):i=Xr(e,t,n),typeof t.shown<`u`&&t.shown!==e.$_popperOldShown&&(e.$_popperOldShown=t.shown,t.shown?i.show():i.hide())}}const $r={beforeMount:Qr,updated:Qr,beforeUnmount(e){Zr(e)}};function ei(e){e.addEventListener(`mousedown`,ni),e.addEventListener(`click`,ni),e.addEventListener(`touchstart`,ri,Un?{passive:!0}:!1)}function ti(e){e.removeEventListener(`mousedown`,ni),e.removeEventListener(`click`,ni),e.removeEventListener(`touchstart`,ri),e.removeEventListener(`touchend`,ii),e.removeEventListener(`touchcancel`,ai)}function ni(e){let t=e.currentTarget;e.closePopover=!t.$_vclosepopover_touch,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}function ri(e){if(e.changedTouches.length===1){let t=e.currentTarget;t.$_vclosepopover_touch=!0;let n=e.changedTouches[0];t.$_vclosepopover_touchPoint=n,t.addEventListener(`touchend`,ii),t.addEventListener(`touchcancel`,ai)}}function ii(e){let t=e.currentTarget;if(t.$_vclosepopover_touch=!1,e.changedTouches.length===1){let n=e.changedTouches[0],r=t.$_vclosepopover_touchPoint;e.closePopover=Math.abs(n.screenY-r.screenY)<20&&Math.abs(n.screenX-r.screenX)<20,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}}function ai(e){let t=e.currentTarget;t.$_vclosepopover_touch=!1}const oi={beforeMount(e,{value:t,modifiers:n}){e.$_closePopoverModifiers=n,(typeof t>`u`||t)&&ei(e)},updated(e,{value:t,oldValue:n,modifiers:r}){e.$_closePopoverModifiers=r,t!==n&&(typeof t>`u`||t?ei(e):ti(e))},beforeUnmount(e){ti(e)}},si=J,ci=$r,li=$r,ui=oi,di=oi,fi=Fr,pi=Ir,mi=er,hi=kr,gi=Ar,_i=Pr,vi=xr,yi=Lr,bi=Hr,xi={class:`flex-1 truncate`},Si={class:`min-w-[160px] flex flex-col gap-0.5 border border-neutral-200 rounded-lg bg-white p-1 shadow-lg dark:border-neutral-800 dark:bg-neutral-900`},Ci=[`onClick`];var wi=f({__name:`Select`,props:_({options:null,placeholder:null,disabled:{type:Boolean},title:null},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=e,r=N(e,`modelValue`),a=i(()=>{let e=n.options.find(e=>e.value===r.value);return e?e.label:n.placeholder});function c(e){r.value=e}return(e,i)=>(w(),s(M(fi),{"auto-size":``,"auto-boundary-max-size":``},{popper:P(({hide:i})=>[o(`div`,Si,[(w(!0),l(t,null,O(n.options,t=>(w(),l(`div`,v({ref_for:!0},{...e.$attrs,class:null,style:null},{key:t.value,class:[`cursor-pointer rounded px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800`,{"bg-neutral-100 dark:bg-neutral-800":r.value===t.value}],onClick:e=>{c(t.value),i()}}),j(t.label),17,Ci))),128))])]),default:P(()=>[o(`div`,{class:b([`min-w-[160px] flex cursor-pointer items-center justify-between gap-2 border rounded-lg bg-white p-2.5 text-xs text-neutral-700 shadow-sm outline-none transition-colors disabled:cursor-not-allowed dark:border-neutral-800 dark:bg-neutral-900 disabled:bg-neutral-100 hover:bg-neutral-50 dark:text-neutral-200 disabled:text-neutral-400 focus:ring-2 focus:ring-black/10 dark:disabled:bg-neutral-800 dark:hover:bg-neutral-800 dark:disabled:text-neutral-600`,{"pointer-events-none":n.disabled}])},[o(`div`,xi,[k(e.$slots,`default`,{label:a.value},()=>[u(j(a.value),1)])]),i[0]||=o(`div`,{"i-solar:alt-arrow-down-bold-duotone":``,class:`h-3.5 w-3.5 text-neutral-500 dark:text-neutral-400`},null,-1)],2)]),_:3}))}}),Ti=wi;export{dn as ColorHueRange_default,_t as FieldCheckbox_default,Ot as FieldInput_default,Bt as FieldKeyValues_default,Qt as FieldRange_default,cn as FieldValues_default,bt as Input_default,Ti as Select_default,Ie as arrow,Pe as computePosition,ve as createCoords,ze as flip,_e as floor,He as hide,Ke as limitShift,I as max,he as min,We as offset,V as rectToClientRect,ge as round,Ge as shift,qe as size}; \ No newline at end of file +import{Comment as e,Fragment as t,__plugin_vue_export_helper_default as n,cloneVNode as r,computed as i,createApp as a,createBaseVNode as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createTextVNode as u,createVNode as d,defineComponent as f,getCurrentInstance as p,guardReactiveProps as m,h,inject as g,mergeModels as _,mergeProps as v,nextTick as y,normalizeClass as b,normalizeProps as x,normalizeStyle as S,onMounted as C,openBlock as w,popScopeId as T,provide as E,pushScopeId as ee,ref as D,renderList as O,renderSlot as k,resolveComponent as A,resolveDirective as te,toDisplayString as j,toRefs as ne,toValue as re,unref as M,unrefElement$1 as ie,useModel as N,useVModel as ae,vModelDynamic as oe,vModelText as se,watch as ce,withCtx as P,withDirectives as F,withKeys as le,withModifiers as ue,withScopeId as de}from"./index-DKziOBM4.js";const fe=[`top`,`right`,`bottom`,`left`],pe=[`start`,`end`],me=fe.reduce((e,t)=>e.concat(t,t+`-`+pe[0],t+`-`+pe[1]),[]),he=Math.min,I=Math.max,ge=Math.round,_e=Math.floor,ve=e=>({x:e,y:e}),ye={left:`right`,right:`left`,bottom:`top`,top:`bottom`},be={start:`end`,end:`start`};function xe(e,t,n){return I(e,he(t,n))}function L(e,t){return typeof e==`function`?e(t):e}function R(e){return e.split(`-`)[0]}function z(e){return e.split(`-`)[1]}function Se(e){return e===`x`?`y`:`x`}function Ce(e){return e===`y`?`height`:`width`}function B(e){return[`top`,`bottom`].includes(R(e))?`y`:`x`}function we(e){return Se(B(e))}function Te(e,t,n){n===void 0&&(n=!1);let r=z(e),i=we(e),a=Ce(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ae(o)),[o,Ae(o)]}function Ee(e){let t=Ae(e);return[De(e),t,De(t)]}function De(e){return e.replace(/start|end/g,e=>be[e])}function Oe(e,t,n){let r=[`left`,`right`],i=[`right`,`left`],a=[`top`,`bottom`],o=[`bottom`,`top`];switch(e){case`top`:case`bottom`:return n?t?i:r:t?r:i;case`left`:case`right`:return t?a:o;default:return[]}}function ke(e,t,n,r){let i=z(e),a=Oe(R(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(De)))),a}function Ae(e){return e.replace(/left|right|bottom|top/g,e=>ye[e])}function je(e){return{top:0,right:0,bottom:0,left:0,...e}}function Me(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:je(e)}function V(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ne(e,t,n){let{reference:r,floating:i}=e,a=B(t),o=we(t),s=Ce(o),c=R(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(z(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}const Pe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ne(l,r,c),f=r,p={},m=0;for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=L(e,t)||{};if(l==null)return{};let d=Me(u),f={x:n,y:r},p=we(i),m=Ce(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=he(d[_],T),ee=he(d[v],T),D=E,O=C-h[m]-ee,k=C/2-h[m]/2+w,A=xe(D,k,O),te=!c.arrow&&z(i)!=null&&k!==A&&a.reference[m]/2-(kz(t)===e),...n.filter(t=>z(t)!==e)]:n.filter(e=>R(e)===e);return r.filter(n=>e?z(n)===e||(t?De(n)!==n:!1):!0)}const Re=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){var n,r,i;let{rects:a,middlewareData:o,placement:s,platform:c,elements:l}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:f=me,autoAlignment:p=!0,...m}=L(e,t),h=d!==void 0||f===me?Le(d||null,p,f):f,g=await Fe(t,m),_=(n=o.autoPlacement)?.index||0,v=h[_];if(v==null)return{};let y=Te(v,a,await(c.isRTL==null?void 0:c.isRTL(l.floating)));if(s!==v)return{reset:{placement:h[0]}};let b=[g[R(v)],g[y[0]],g[y[1]]],x=[...(r=o.autoPlacement)?.overflows||[],{placement:v,overflows:b}],S=h[_+1];if(S)return{data:{index:_+1,overflows:x},reset:{placement:S}};let C=x.map(e=>{let t=z(e.placement);return[e.placement,t&&u?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),w=C.filter(e=>e[2].slice(0,z(e[0])?2:3).every(e=>e<=0)),T=(i=w[0])?.[0]||C[0][0];return T===s?{}:{data:{index:_+1,overflows:x},reset:{placement:T}}}}},ze=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n,r;let{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0,...g}=L(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let _=R(i),v=B(s),y=R(s)===s,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),x=f||(y||!h?[Ae(s)]:Ee(s)),S=m!==`none`;!f&&S&&x.push(...ke(s,h,m,b));let C=[s,...x],w=await Fe(t,g),T=[],E=(r=a.flip)?.overflows||[];if(u&&T.push(w[_]),d){let e=Te(i,o,b);T.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:i,overflows:T}],!T.every(e=>e<=0)){var ee,D;let e=((ee=a.flip)?.index||0)+1,t=C[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let n=(D=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?.placement;if(!n)switch(p){case`bestFit`:{var O;let e=(O=E.filter(e=>{if(S){let t=B(e.placement);return t===v||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?.[0];e&&(n=e);break}case`initialPlacement`:n=s;break}if(i!==n)return{reset:{placement:n}}}return{}}}};function Be(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ve(e){return fe.some(t=>e[t]>=0)}const He=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=L(e,t);switch(r){case`referenceHidden`:{let e=await Fe(t,{...i,elementContext:`reference`}),r=Be(e,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Ve(r)}}}case`escaped`:{let e=await Fe(t,{...i,altBoundary:!0}),r=Be(e,n.floating);return{data:{escapedOffsets:r,escaped:Ve(r)}}}default:return{}}}}};async function Ue(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=R(n),s=z(n),c=B(n)===`y`,l=[`left`,`top`].includes(o)?-1:1,u=a&&c?-1:1,d=L(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}const We=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n,r;let{x:i,y:a,placement:o,middlewareData:s}=t,c=await Ue(t,e);return o===(n=s.offset)?.placement&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},Ge=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=L(e,t),l={x:n,y:r},u=await Fe(t,c),d=B(R(i)),f=Se(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=xe(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=xe(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Ke=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=L(e,t),u={x:n,y:r},d=B(i),f=Se(d),p=u[f],m=u[d],h=L(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){var _,v;let e=f===`y`?`width`:`height`,t=[`top`,`left`].includes(R(i)),n=a.reference[d]-a.floating[e]+(t&&(_=o.offset)?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:(v=o.offset)?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},qe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=L(e,t),u=await Fe(t,l),d=R(i),f=z(i),p=B(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=he(h-u[g],v),x=he(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=I(u.left,0),t=I(u.right,0),n=I(u.top,0),r=I(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:I(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:I(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Je(e){return e?e.flatMap(e=>e.type===t?Je(e.children):[e]):[]}const Ye=f({name:`PrimitiveSlot`,inheritAttrs:!1,setup(t,{attrs:n,slots:i}){return()=>{var t;if(!i.default)return null;let a=Je(i.default()),o=a.findIndex(t=>t.type!==e);if(o===-1)return a;let s=a[o];(t=s.props)==null||delete t.ref;let c=s.props?v(n,s.props):n,l=r({...s,props:{}},c);return a.length===1?l:(a[o]=l,a)}}}),Xe=[`area`,`img`,`input`],Ze=f({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Xe.includes(r)?()=>h(r,t):r===`template`?()=>h(Ye,t,{default:n.default}):()=>h(e.as,t,{default:n.default})}}),Qe=f({__name:`VisuallyHidden`,props:{feature:{default:`focusable`},asChild:{type:Boolean},as:{default:`span`}},setup(e){return(e,t)=>(w(),s(M(Ze),{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:P(()=>[k(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}});function $e(e,t){let n=typeof e==`string`&&!t?`${e}Context`:t,r=Symbol(n),i=t=>{let n=g(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},a=e=>(E(r,e),e);return[i,a]}function et(){let e=p(),t=D(),n=i(()=>{var e,n;return[`#text`,`#comment`].includes((e=t.value)?.$el.nodeName)?(n=t.value)?.$el.nextElementSibling:ie(t)}),r=Object.assign({},e.exposed),a={};for(let t in e.props)Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(r).length>0)for(let e in r)Object.defineProperty(a,e,{enumerable:!0,configurable:!0,get:()=>r[e]});Object.defineProperty(a,`$el`,{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=a;function o(n){t.value=n,n&&(Object.defineProperty(a,`$el`,{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),e.exposed=a)}return{forwardRef:o,currentRef:t,currentElement:n}}function tt(){let e=D(),t=i(()=>{var t,n;return[`#text`,`#comment`].includes((t=e.value)?.$el.nodeName)?(n=e.value)?.$el.nextElementSibling:ie(e)});return{primitiveElement:e,currentElement:t}}function nt(e){return i(()=>{var t;return re(e)?!!(t=ie(e))?.closest(`form`):!0})}const rt=f({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=tt(),a=i(()=>t.checked??t.value);return ce(a,(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`),o=a.set;if(o&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});o.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(w(),s(Qe,v({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),it=f({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:`fully-hidden`}},setup(e){let n=e,r=i(()=>typeof n.value==`object`&&Array.isArray(n.value)&&n.value.length===0&&n.required),a=i(()=>typeof n.value==`string`||typeof n.value==`number`||typeof n.value==`boolean`?[{name:n.name,value:n.value}]:typeof n.value==`object`&&Array.isArray(n.value)?n.value.flatMap((e,t)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`[${n.name}][${t}][${e}]`,value:r})):{name:`[${n.name}][${t}]`,value:e}):n.value!==null&&typeof n.value==`object`&&!Array.isArray(n.value)?Object.entries(n.value).map(([e,t])=>({name:`[${n.name}][${e}]`,value:t})):[]);return(e,i)=>r.value?(w(),s(rt,v({key:e.name},{...n,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(w(!0),l(t,{key:1},O(a.value,t=>(w(),s(rt,v({key:t.name,ref_for:!0},{...n,...e.$attrs},{name:t.name,value:t.value}),null,16,[`name`,`value`]))),128))}}),[at,ot]=$e(`SwitchRoot`),st=f({__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(e,{emit:t}){let n=e,r=t,{disabled:a}=ne(n),o=ae(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function l(){a.value||(o.value=!o.value)}let{forwardRef:u,currentElement:d}=et(),f=nt(d),p=i(()=>{var e;return n.id&&d.value?(e=document.querySelector(`[for="${n.id}"]`))?.innerText:void 0});return ot({modelValue:o,toggleCheck:l,disabled:a}),(e,t)=>(w(),s(M(Ze),v(e.$attrs,{id:e.id,ref:M(u),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||p.value,"aria-checked":M(o),"aria-required":e.required,"data-state":M(o)?`checked`:`unchecked`,"data-disabled":M(a)?``:void 0,"as-child":e.asChild,as:e.as,disabled:M(a),onClick:l,onKeydown:le(ue(l,[`prevent`]),[`enter`])}),{default:P(()=>[k(e.$slots,`default`,{modelValue:M(o)}),M(f)&&e.name?(w(),s(M(it),{key:0,type:`checkbox`,name:e.name,disabled:M(a),required:e.required,value:e.value,checked:!!M(o)},null,8,[`name`,`disabled`,`required`,`value`,`checked`])):c(``,!0)]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]))}}),ct=f({__name:`SwitchThumb`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=at();return et(),(e,n)=>{var r;return w(),s(M(Ze),{"data-state":(r=M(t).modelValue)?.value?`checked`:`unchecked`,"data-disabled":M(t).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:P(()=>[k(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`])}}});var lt=f({__name:`Checkbox`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=N(e,`modelValue`);return(e,n)=>(w(),s(M(st),{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,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:P(()=>[d(M(ct),{"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`]))}}),ut=lt;const dt={flex:`~ col gap-4`},ft={flex:`~ row`,"items-center":``,"gap-2":``},pt={flex:`1`},mt={class:`flex items-center gap-1 text-sm font-medium`},ht={class:`text-xs text-neutral-500 dark:text-neutral-400`};var gt=f({__name:`FieldCheckbox`,props:_({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=N(e,`modelValue`);return(e,r)=>(w(),l(`label`,dt,[o(`div`,ft,[o(`div`,pt,[o(`div`,mt,j(t.label),1),o(`div`,ht,j(t.description),1)]),d(ut,{modelValue:n.value,"onUpdate:modelValue":r[0]||=e=>n.value=e},null,8,[`modelValue`])])]))}}),_t=gt;const vt=[`type`];var yt=f({__name:`Input`,props:_({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=N(e,`modelValue`);return(e,r)=>F((w(),l(`input`,{"onUpdate:modelValue":r[0]||=e=>n.value=e,type:t.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,vt)),[[oe,n.value]])}}),bt=yt;const xt={"max-w-full":``},St={flex:`~ col gap-4`},Ct={class:`flex items-center gap-1 text-sm font-medium`},wt={key:0,class:`text-red-500`},Tt={class:`text-xs text-neutral-500 dark:text-neutral-400`,"text-nowrap":``},Et=[`type`,`placeholder`];var Dt=f({__name:`FieldInput`,props:_({label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null,singleLine:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=N(e,`modelValue`);return(r,i)=>(w(),l(`div`,xt,[o(`label`,St,[o(`div`,null,[o(`div`,Ct,[u(j(t.label)+` `,1),t.required===!1?c(``,!0):(w(),l(`span`,wt,`*`))]),o(`div`,Tt,j(t.description),1)]),e.singleLine?(w(),s(bt,{key:0,modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,type:t.type,placeholder:t.placeholder,class:b(t.inputClass)},null,8,[`modelValue`,`type`,`placeholder`,`class`])):F((w(),l(`textarea`,{key:1,"onUpdate:modelValue":i[1]||=e=>n.value=e,type:t.type,placeholder:t.placeholder,class:b(t.inputClass),border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,10,Et)),[[se,n.value]])])]))}}),Ot=Dt;const kt={flex:`~ gap-2`};var At=f({__name:`InputKeyValue`,props:_({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:[`update:propertyKey`,`update:propertyValue`],setup(e){let t=e,n=N(e,`propertyKey`),r=N(e,`propertyValue`);return(e,i)=>(w(),l(`div`,kt,[d(bt,{modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,placeholder:t.keyPlaceholder,class:`w-1/2`},null,8,[`modelValue`,`placeholder`]),d(bt,{modelValue:r.value,"onUpdate:modelValue":i[1]||=e=>r.value=e,placeholder:t.valuePlaceholder,class:`w-1/2`},null,8,[`modelValue`,`placeholder`])]))}}),jt=At;const Mt={"max-w-full":``},Nt={flex:`~ col gap-2`},Pt={class:`flex items-center gap-1 text-sm font-medium`},Ft={key:0,class:`text-red-500`},It={class:`text-xs text-neutral-500 dark:text-neutral-400`,"text-nowrap":``},Lt={flex:`~ col gap-2`},Rt=[`onClick`];var zt=f({__name:`FieldKeyValues`,props:_({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:_([`remove`,`add`],[`update:modelValue`]),setup(e,{emit:n}){let r=e,i=n,a=N(e,`modelValue`),s=D(``),f=D(``);return ce([s,f],()=>{i(`add`,s.value,f.value)}),(e,n)=>{let s=te(`auto-animate`);return w(),l(`div`,Mt,[o(`label`,Nt,[o(`div`,null,[o(`div`,Pt,[u(j(r.label)+` `,1),r.required===!1?c(``,!0):(w(),l(`span`,Ft,`*`))]),o(`div`,It,j(r.description),1)]),F((w(),l(`div`,Lt,[(w(!0),l(t,null,O(a.value,(e,t)=>(w(),l(`div`,{key:t,"w-full":``,flex:``,"items-center":``,"gap-2":``},[d(jt,{"property-key":e.key,"onUpdate:propertyKey":t=>e.key=t,"property-value":e.value,"onUpdate:propertyValue":t=>e.value=t,"key-placeholder":r.keyPlaceholder,"value-placeholder":r.valuePlaceholder,"w-full":``},null,8,[`property-key`,`onUpdate:propertyKey`,`property-value`,`onUpdate:propertyValue`,`key-placeholder`,`value-placeholder`]),o(`button`,{onClick:e=>i(`remove`,t)},n[0]||=[o(`div`,{"i-solar:minus-circle-line-duotone":``,size:`6`},null,-1)],8,Rt)]))),128))])),[[s]])])])}}}),Bt=zt;const Vt=[`min`,`max`,`step`];var Ht=f({__name:`Range`,props:_({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(e){let t=e,n=N(e,`modelValue`),r=i(()=>t.min*1e4),a=i(()=>t.max*1e4),o=i(()=>t.step*1e4),s=D(),c=i({get:()=>n.value*1e4,set:e=>{n.value=e/1e4,u()}});C(()=>{u()});function u(){s.value&&(s.value.style.setProperty(`--value`,s.value.value),s.value.style.setProperty(`--min`,s.value.min?s.value.min:t.min.toString()),s.value.style.setProperty(`--max`,s.value.max?s.value.max:t.max.toString()))}function d(e){let t=e.target;t.style.setProperty(`--value`,t.value)}return(e,t)=>F((w(),l(`input`,{ref_key:`sliderRef`,ref:s,"onUpdate:modelValue":t[0]||=e=>c.value=e,type:`range`,min:r.value,max:a.value,step:o.value,class:`slider-progress form_input-range`,onInput:d},null,40,Vt)),[[se,c.value,void 0,{number:!0}]])}}),Ut=n(Ht,[[`__scopeId`,`data-v-c59a94f0`]]);const Wt={flex:`~ col gap-4`},Gt={flex:`~ row`,"items-center":``,"gap-2":``},Kt={flex:`1`},qt={class:`flex items-center gap-1 text-sm font-medium`},Jt={class:`text-xs text-neutral-500 dark:text-neutral-400`},Yt={"font-mono":``},Xt={flex:`~ row`,"items-center":``,"gap-2":``};var Zt=f({__name:`FieldRange`,props:_({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=N(e,`modelValue`);return(r,i)=>{var a;return w(),l(`label`,Wt,[o(`div`,Gt,[o(`div`,Kt,[o(`div`,qt,j(e.label),1),o(`div`,Jt,j(e.description),1)]),o(`span`,Yt,j((a=t.formatValue)?.call(t,n.value)||n.value),1)]),o(`div`,Xt,[d(Ut,{modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,min:e.min||0,max:e.max||1,step:e.step||.01,"w-full":``},null,8,[`modelValue`,`min`,`max`,`step`])])])}}}),Qt=Zt;const $t={class:`max-w-full`},en={class:`flex flex-col gap-2`},tn={class:`flex items-center gap-1 text-sm font-medium`},nn={key:0,class:`text-red-500`},rn={class:`text-nowrap text-xs text-neutral-500 dark:text-neutral-400`},an={class:`~ col gap-2`},on=[`onClick`];var sn=f({__name:`FieldValues`,props:_({label:null,description:null,name:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:_([`remove`,`add`],[`update:modelValue`]),setup(e,{emit:n}){let r=e,i=n,a=N(e,`modelValue`);function s(){a.value.push(``),i(`add`)}function f(e){a.value.splice(e,1),i(`remove`,e)}return(e,n)=>{let i=te(`auto-animate`);return w(),l(`div`,$t,[o(`label`,en,[o(`div`,null,[o(`div`,tn,[u(j(r.label)+` `,1),r.required===!1?c(``,!0):(w(),l(`span`,nn,`*`))]),o(`div`,rn,j(r.description),1)]),F((w(),l(`div`,an,[(w(!0),l(t,null,O(a.value,(e,t)=>(w(),l(`div`,{key:t,class:`w-full flex items-center gap-2`},[d(bt,{modelValue:a.value[t],"onUpdate:modelValue":e=>a.value[t]=e,placeholder:r.valuePlaceholder,class:`w-90%`},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`]),o(`button`,{"i-solar:minus-circle-line-duotone":``,size:`6`,class:`min-w-20px w-10% flex text-red-500`,onClick:e=>f(t)},null,8,on)]))),128)),o(`div`,{"i-solar:add-circle-line-duotone":``,size:`6`,class:`mt-2 w-4/5 text-blue-500`,onClick:s})])),[[i]])])])}}}),cn=sn;const ln=[`disabled`];var un=f({__name:`ColorHueRange`,props:_({disabled:{type:Boolean},class:null},{colorValue:{type:String,default:``},colorValueModifiers:{}}),emits:[`update:colorValue`],setup(e){let t=e,n=N(e,`colorValue`);return(e,r)=>F((w(),l(`input`,{"onUpdate:modelValue":r[0]||=e=>n.value=e,type:`range`,min:`0`,max:`360`,step:`0.01`,class:b([`color-hue-range`,[t.disabled?`opacity-25 cursor-not-allowed`:`cursor-pointer`,t.class||``]]),transition:`all ease-in-out duration-250`,disabled:t.disabled},null,10,ln)),[[se,n.value]])}}),dn=n(un,[[`__scopeId`,`data-v-ae80cb9d`]]);function H(e){var t;return(t=e.ownerDocument)?.defaultView||window}function U(e){return H(e).getComputedStyle(e)}const fn=Math.min,pn=Math.max,mn=Math.round;function hn(e){let t=U(e),n=parseFloat(t.width),r=parseFloat(t.height),i=e.offsetWidth,a=e.offsetHeight,o=mn(n)!==i||mn(r)!==a;return o&&(n=i,r=a),{width:n,height:r,fallback:o}}function W(e){return vn(e)?(e.nodeName||``).toLowerCase():``}let gn;function _n(){if(gn)return gn;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(gn=e.brands.map(e=>e.brand+`/`+e.version).join(` `),gn):navigator.userAgent}function G(e){return e instanceof H(e).HTMLElement}function K(e){return e instanceof H(e).Element}function vn(e){return e instanceof H(e).Node}function yn(e){return typeof ShadowRoot>`u`?!1:e instanceof H(e).ShadowRoot||e instanceof ShadowRoot}function bn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function xn(e){return[`table`,`td`,`th`].includes(W(e))}function Sn(e){let t=/firefox/i.test(_n()),n=U(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!==`none`||n.perspective!==`none`||!!r&&r!==`none`||t&&n.willChange===`filter`||t&&!!n.filter&&n.filter!==`none`||[`transform`,`perspective`].some(e=>n.willChange.includes(e))||[`paint`,`layout`,`strict`,`content`].some(e=>{let t=n.contain;return t!=null&&t.includes(e)})}function Cn(){return!/^((?!chrome|android).)*safari/i.test(_n())}function wn(e){return[`html`,`body`,`#document`].includes(W(e))}function Tn(e){return K(e)?e:e.contextElement}const En={x:1,y:1};function Dn(e){let t=Tn(e);if(!G(t))return En;let n=t.getBoundingClientRect(),{width:r,height:i,fallback:a}=hn(t),o=(a?mn(n.width):n.width)/r,s=(a?mn(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}function On(e,t,n,r){var i,a;t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),s=Tn(e),c=En;t&&(r?K(r)&&(c=Dn(r)):c=Dn(e));let l=s?H(s):window,u=!Cn()&&n,d=(o.left+(u&&(i=l.visualViewport)?.offsetLeft||0))/c.x,f=(o.top+(u&&(a=l.visualViewport)?.offsetTop||0))/c.y,p=o.width/c.x,m=o.height/c.y;if(s){let e=H(s),t=r&&K(r)?H(r):r,n=e.frameElement;for(;n&&r&&t!==e;){let e=Dn(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,f*=e.y,p*=e.x,m*=e.y,d+=t.x,f+=t.y,n=H(n).frameElement}}return{width:p,height:m,top:f,right:d+p,bottom:f+m,left:d,x:d,y:f}}function q(e){return((vn(e)?e.ownerDocument:e.document)||window.document).documentElement}function kn(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function An(e){return On(q(e)).left+kn(e).scrollLeft}function jn(e){if(W(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||yn(e)&&e.host||q(e);return yn(t)?t.host:t}function Mn(e){let t=jn(e);return wn(t)?t.ownerDocument.body:G(t)&&bn(t)?t:Mn(t)}function Nn(e,t){var n;t===void 0&&(t=[]);let r=Mn(e),i=r===(n=e.ownerDocument)?.body,a=H(r);return i?t.concat(a,a.visualViewport||[],bn(r)?r:[]):t.concat(r,Nn(r))}function Pn(e,t,n){return t===`viewport`?V(function(e,t){let n=H(e),r=q(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Cn();(e||!e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}(e,n)):K(t)?V(function(e,t){let n=On(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=G(e)?Dn(e):{x:1,y:1};return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n)):V(function(e){let t=q(e),n=kn(e),r=e.ownerDocument.body,i=pn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=pn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+An(e),s=-n.scrollTop;return U(r).direction===`rtl`&&(o+=pn(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(q(e)))}function Fn(e){return G(e)&&U(e).position!==`fixed`?e.offsetParent:null}function In(e){let t=H(e),n=Fn(e);for(;n&&xn(n)&&U(n).position===`static`;)n=Fn(n);return n&&(W(n)===`html`||W(n)===`body`&&U(n).position===`static`&&!Sn(n))?t:n||function(e){let t=jn(e);for(;G(t)&&!wn(t);){if(Sn(t))return t;t=jn(t)}return null}(e)||t}function Ln(e,t,n){let r=G(t),i=q(t),a=On(e,!0,n===`fixed`,t),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&n!==`fixed`)if((W(t)!==`body`||bn(i))&&(o=kn(t)),G(t)){let e=On(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=An(i));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}const Rn={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=n===`clippingAncestors`?function(e,t){let n=t.get(e);if(n)return n;let r=Nn(e).filter(e=>K(e)&&W(e)!==`body`),i=null,a=U(e).position===`fixed`,o=a?jn(e):e;for(;K(o)&&!wn(o);){let e=U(o),t=Sn(o);(a?t||i:t||e.position!==`static`||!i||![`absolute`,`fixed`].includes(i.position))?i=e:r=r.filter(e=>e!==o),o=jn(o)}return t.set(e,r),r}(t,this._c):[].concat(n),o=[...a,r],s=o[0],c=o.reduce((e,n)=>{let r=Pn(t,n,i);return e.top=pn(r.top,e.top),e.right=fn(r.right,e.right),e.bottom=fn(r.bottom,e.bottom),e.left=pn(r.left,e.left),e},Pn(t,s,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=G(n),a=q(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((i||!i&&r!==`fixed`)&&((W(n)!==`body`||bn(a))&&(o=kn(n)),G(n))){let e=On(n);s=Dn(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-o.scrollLeft*s.x+c.x,y:t.y*s.y-o.scrollTop*s.y+c.y}},isElement:K,getDimensions:function(e){return G(e)?hn(e):e.getBoundingClientRect()},getOffsetParent:In,getDocumentElement:q,getScale:Dn,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e,i=this.getOffsetParent||In,a=this.getDimensions;return{reference:Ln(t,await i(n),r),floating:{x:0,y:0,...await a(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>U(e).direction===`rtl`},zn=(e,t,n)=>{let r=new Map,i={platform:Rn,...n},a={...i.platform,_c:r};return Pe(e,t,{...i,platform:a})},J={disabled:!1,distance:5,skidding:0,container:`body`,boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:`absolute`,preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:`top`,triggers:[`hover`,`focus`,`touch`],hideTriggers:e=>[...e,`click`],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:`...`},dropdown:{placement:`bottom`,triggers:[`click`],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:`dropdown`,triggers:[`hover`,`focus`],popperTriggers:[`hover`],delay:{show:0,hide:400}}}};function Bn(e,t){let n=J.themes[e]||{},r;do r=n[t],typeof r>`u`?n.$extend?n=J.themes[n.$extend]||{}:(n=null,r=J[t]):n=null;while(n);return r}function Vn(e){let t=[e],n=J.themes[e]||{};do n.$extend&&!n.$resetCss?(t.push(n.$extend),n=J.themes[n.$extend]||{}):n=null;while(n);return t.map(e=>`v-popper--theme-${e}`)}function Hn(e){let t=[e],n=J.themes[e]||{};do n.$extend?(t.push(n.$extend),n=J.themes[n.$extend]||{}):n=null;while(n);return t}let Un=!1;if(typeof window<`u`){Un=!1;try{let e=Object.defineProperty({},`passive`,{get(){Un=!0}});window.addEventListener(`test`,null,e)}catch{}}let Wn=!1;typeof window<`u`&&typeof navigator<`u`&&(Wn=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const Gn=[`auto`,`top`,`bottom`,`left`,`right`].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),Kn={hover:`mouseenter`,focus:`focus`,click:`click`,touch:`touchstart`,pointer:`pointerdown`},qn={hover:`mouseleave`,focus:`blur`,click:`click`,touch:`touchend`,pointer:`pointerup`};function Jn(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}function Yn(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const Y=[];let X=null;const Xn={};function Zn(e){let t=Xn[e];return t||=Xn[e]=[],t}let Qn=function(){};typeof window<`u`&&(Qn=window.Element);function Z(e){return function(t){return Bn(t.theme,e)}}const $n=`__floating-vue__popper`,er=()=>f({name:`VPopper`,provide(){return{[$n]:{parentPopper:this}}},inject:{[$n]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:Z(`disabled`)},positioningDisabled:{type:Boolean,default:Z(`positioningDisabled`)},placement:{type:String,default:Z(`placement`),validator:e=>Gn.includes(e)},delay:{type:[String,Number,Object],default:Z(`delay`)},distance:{type:[Number,String],default:Z(`distance`)},skidding:{type:[Number,String],default:Z(`skidding`)},triggers:{type:Array,default:Z(`triggers`)},showTriggers:{type:[Array,Function],default:Z(`showTriggers`)},hideTriggers:{type:[Array,Function],default:Z(`hideTriggers`)},popperTriggers:{type:Array,default:Z(`popperTriggers`)},popperShowTriggers:{type:[Array,Function],default:Z(`popperShowTriggers`)},popperHideTriggers:{type:[Array,Function],default:Z(`popperHideTriggers`)},container:{type:[String,Object,Qn,Boolean],default:Z(`container`)},boundary:{type:[String,Qn],default:Z(`boundary`)},strategy:{type:String,validator:e=>[`absolute`,`fixed`].includes(e),default:Z(`strategy`)},autoHide:{type:[Boolean,Function],default:Z(`autoHide`)},handleResize:{type:Boolean,default:Z(`handleResize`)},instantMove:{type:Boolean,default:Z(`instantMove`)},eagerMount:{type:Boolean,default:Z(`eagerMount`)},popperClass:{type:[String,Array,Object],default:Z(`popperClass`)},computeTransformOrigin:{type:Boolean,default:Z(`computeTransformOrigin`)},autoMinSize:{type:Boolean,default:Z(`autoMinSize`)},autoSize:{type:[Boolean,String],default:Z(`autoSize`)},autoMaxSize:{type:Boolean,default:Z(`autoMaxSize`)},autoBoundaryMaxSize:{type:Boolean,default:Z(`autoBoundaryMaxSize`)},preventOverflow:{type:Boolean,default:Z(`preventOverflow`)},overflowPadding:{type:[Number,String],default:Z(`overflowPadding`)},arrowPadding:{type:[Number,String],default:Z(`arrowPadding`)},arrowOverflow:{type:Boolean,default:Z(`arrowOverflow`)},flip:{type:Boolean,default:Z(`flip`)},shift:{type:Boolean,default:Z(`shift`)},shiftCrossAxis:{type:Boolean,default:Z(`shiftCrossAxis`)},noAutoFocus:{type:Boolean,default:Z(`noAutoFocus`)},disposeTimeout:{type:Number,default:Z(`disposeTimeout`)}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:``,strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join(`_`)}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId==null?this.randomId:this.ariaId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide==`function`?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[$n])?.parentPopper},hasPopperShowTriggerHover(){var e,t;return(e=this.popperTriggers)?.includes(`hover`)||(t=this.popperShowTriggers)?.includes(`hover`)}},watch:{shown:`$_autoShowHide`,disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:`$_refreshListeners`,deep:!0},positioningDisabled:`$_refreshListeners`,...[`placement`,`distance`,`skidding`,`boundary`,`strategy`,`overflowPadding`,`arrowPadding`,`preventOverflow`,`shift`,`shiftCrossAxis`,`flip`].reduce((e,t)=>(e[t]=`$_computePosition`,e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:n=!1}={}){var r,i;(r=this.parentPopper)!=null&&r.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(n||!this.disabled)&&((i=this.parentPopper)?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit(`show`),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit(`update:shown`,!0))},hide({event:e=null,skipDelay:t=!1}={}){var n;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}(n=this.parentPopper)?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit(`hide`),this.$emit(`update:shown`,!1)}},init(){var e;this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=(e=this.referenceNode)?.call(this)??this.$el,this.$_targetNodes=this.targetNodes().filter(e=>e.nodeType===e.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(`.v-popper__inner`),this.$_arrowNode=this.$_popperNode.querySelector(`.v-popper__arrow-container`),this.$_swapTargetAttrs(`title`,`data-original-title`),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs(`data-original-title`,`title`))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit(`resize`))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;let e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(We({mainAxis:this.distance,crossAxis:this.skidding}));let t=this.placement.startsWith(`auto`);if(t?e.middleware.push(Re({alignment:this.placement.split(`-`)[1]??``})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(Ge({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(ze({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(Ie({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:`arrowOverflow`,fn:({placement:e,rects:t,middlewareData:n})=>{let r,{centerOffset:i}=n.arrow;return r=e.startsWith(`top`)||e.startsWith(`bottom`)?Math.abs(i)>t.reference.width/2:Math.abs(i)>t.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){let t=this.autoSize?this.autoSize:this.autoMinSize?`min`:null;e.middleware.push({name:`autoSize`,fn:({rects:e,placement:n,middlewareData:r})=>{var i;if((i=r.autoSize)!=null&&i.skip)return{};let a,o;return n.startsWith(`top`)||n.startsWith(`bottom`)?a=e.reference.width:o=e.reference.height,this.$_innerNode.style[t===`min`?`minWidth`:t===`max`?`maxWidth`:`width`]=a==null?null:`${a}px`,this.$_innerNode.style[t===`min`?`minHeight`:t===`max`?`maxHeight`:`height`]=o==null?null:`${o}px`,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(qe({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:e,availableHeight:t})=>{this.$_innerNode.style.maxWidth=e==null?null:`${e}px`,this.$_innerNode.style.maxHeight=t==null?null:`${t}px`}})));let n=await zn(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:n.x,y:n.y,placement:n.placement,strategy:n.strategy,arrow:{...n.middlewareData.arrow,...n.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),X&&this.instantMove&&X.instantMove&&X!==this.parentPopper){X.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay(`show`))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(X=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay(`hide`))},$_computeDelay(e){let t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await Yn(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...Nn(this.$_referenceNode),...Nn(this.$_popperNode)],`scroll`,()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){let e=this.$_referenceNode.getBoundingClientRect(),t=this.$_popperNode.querySelector(`.v-popper__wrapper`),n=t.parentNode.getBoundingClientRect(),r=e.x+e.width/2-(n.left+t.offsetLeft),i=e.y+e.height/2-(n.top+t.offsetTop);this.result.transformOrigin=`${r}px ${i}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":``});let e=this.showGroup;if(e){let t;for(let n=0;n0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,Jn(Y,this),Y.length===0&&document.body.classList.remove(`v-popper--some-open`);for(let e of Hn(this.theme)){let t=Zn(e);Jn(t,this),t.length===0&&document.body.classList.remove(`v-popper--some-open--${e}`)}X===this&&(X=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);let t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners(`scroll`),this.$emit(`apply-hide`),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await Yn(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e==`string`?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw Error(`No container for popover: `+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){let e=e=>{this.isShown&&!this.$_hideInProgress||(e.usedByTooltip=!0,!this.$_preventShow&&this.show({event:e}))};this.$_registerTriggerListeners(this.$_targetNodes,Kn,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],Kn,this.popperTriggers,this.popperShowTriggers,e);let t=e=>{e.usedByTooltip||this.hide({event:e})};this.$_registerTriggerListeners(this.$_targetNodes,qn,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],qn,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,n){this.$_events.push({targetNodes:e,eventType:t,handler:n}),e.forEach(e=>e.addEventListener(t,n,Un?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,n,r,i){let a=n;r!=null&&(a=typeof r==`function`?r(a):r),a.forEach(n=>{let r=t[n];r&&this.$_registerEventListeners(e,r,i)})},$_removeEventListeners(e){let t=[];this.$_events.forEach(n=>{let{targetNodes:r,eventType:i,handler:a}=n;!e||e===i?r.forEach(e=>e.removeEventListener(i,a)):t.push(n)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit(`close-directive`):this.$emit(`auto-hide`),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(let n of this.$_targetNodes){let r=n.getAttribute(e);r&&(n.removeAttribute(e),n.setAttribute(t,r))}},$_applyAttrsToTarget(e){for(let t of this.$_targetNodes)for(let n in e){let r=e[n];r==null?t.removeAttribute(n):t.setAttribute(n,r)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){let e=this.$_referenceNode.getBoundingClientRect();if(sr>=e.left&&sr<=e.right&&cr>=e.top&&cr<=e.bottom){let e=this.$_popperNode.getBoundingClientRect(),t=sr-Q,n=cr-$,r=e.left+e.width/2-Q+(e.top+e.height/2)-$+e.width+e.height,i=Q+t*r,a=$+n*r;return lr(Q,$,i,a,e.left,e.top,e.left,e.bottom)||lr(Q,$,i,a,e.left,e.top,e.right,e.top)||lr(Q,$,i,a,e.right,e.top,e.right,e.bottom)||lr(Q,$,i,a,e.left,e.bottom,e.right,e.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<`u`&&typeof window<`u`){if(Wn){let e=Un?{passive:!0,capture:!0}:!0;document.addEventListener(`touchstart`,e=>tr(e,!0),e),document.addEventListener(`touchend`,e=>nr(e,!0),e)}else window.addEventListener(`mousedown`,e=>tr(e,!1),!0),window.addEventListener(`click`,e=>nr(e,!1),!0);window.addEventListener(`resize`,or)}function tr(e,t){if(J.autoHideOnMousedown)rr(e,t);else for(let t=0;t=0;r--){let i=Y[r];try{let r=i.containsGlobalTarget=i.mouseDownContains||i.popperNode().contains(e.target);i.pendingHide=!1,requestAnimationFrame(()=>{if(i.pendingHide=!1,!n[i.randomId]&&ir(i,r,e)){if(i.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&r){let e=i.parentPopper;for(;e;)n[e.randomId]=!0,e=e.parentPopper;return}let a=i.parentPopper;for(;a&&ir(a,a.containsGlobalTarget,e);)a.$_handleGlobalClose(e,t),a=a.parentPopper}})}catch{}}}function ir(e,t,n){return n.closeAllPopover||n.closePopover&&t||ar(e,n)&&!t}function ar(e,t){if(typeof e.autoHide==`function`){let n=e.autoHide(t);return e.lastAutoHide=n,n}return e.autoHide}function or(){for(let e=0;e{Q=sr,$=cr,sr=e.clientX,cr=e.clientY},Un?{passive:!0}:void 0);function lr(e,t,n,r,i,a,o,s){let c=((o-i)*(t-a)-(s-a)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t)),l=((n-e)*(t-a)-(r-t)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t));return c>=0&&c<=1&&l>=0&&l<=1}const ur={extends:er()},dr=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};function fr(e,t,n,r,i,a){return w(),l(`div`,{ref:`reference`,class:b([`v-popper`,{"v-popper--shown":e.slotData.isShown}])},[k(e.$slots,`default`,x(m(e.slotData)))],2)}const pr=dr(ur,[[`render`,fr]]);function mr(){var e=window.navigator.userAgent,t=e.indexOf(`MSIE `);if(t>0)return parseInt(e.substring(t+5,e.indexOf(`.`,t)),10);var n=e.indexOf(`Trident/`);if(n>0){var r=e.indexOf(`rv:`);return parseInt(e.substring(r+3,e.indexOf(`.`,r)),10)}var i=e.indexOf(`Edge/`);return i>0?parseInt(e.substring(i+5,e.indexOf(`.`,i)),10):-1}let hr;function gr(){gr.init||(gr.init=!0,hr=mr()!==-1)}var _r={name:`ResizeObserver`,props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:[`notify`],mounted(){gr(),y(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});let e=document.createElement(`object`);this._resizeObject=e,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`tabindex`,-1),e.onload=this.addResizeHandlers,e.type=`text/html`,hr&&this.$el.appendChild(e),e.data=`about:blank`,hr||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit(`notify`,{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener(`resize`,this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!hr&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener(`resize`,this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const vr=de(`data-v-b329ee4c`);ee(`data-v-b329ee4c`);const yr={class:`resize-observer`,tabindex:`-1`};T();const br=vr((e,t,n,r,i,a)=>(w(),s(`div`,yr)));_r.render=br,_r.__scopeId=`data-v-b329ee4c`,_r.__file=`src/components/ResizeObserver.vue`;const xr=(e=`theme`)=>({computed:{themeClass(){return Vn(this[e])}}}),Sr=f({name:`VPopperContent`,components:{ResizeObserver:_r},mixins:[xr()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:[`hide`,`resize`],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),Cr=[`id`,`aria-hidden`,`tabindex`,`data-popper-placement`],wr={ref:`inner`,class:`v-popper__inner`},Tr=o(`div`,{class:`v-popper__arrow-outer`},null,-1),Er=o(`div`,{class:`v-popper__arrow-inner`},null,-1),Dr=[Tr,Er];function Or(e,n,r,i,a,u){let d=A(`ResizeObserver`);return w(),l(`div`,{id:e.popperId,ref:`popover`,class:b([`v-popper__popper`,[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:S(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?`false`:`true`,tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:n[2]||=le(t=>e.autoHide&&e.$emit(`hide`),[`esc`])},[o(`div`,{class:`v-popper__backdrop`,onClick:n[0]||=t=>e.autoHide&&e.$emit(`hide`)}),o(`div`,{class:`v-popper__wrapper`,style:S(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[o(`div`,wr,[e.mounted?(w(),l(t,{key:0},[o(`div`,null,[k(e.$slots,`default`)]),e.handleResize?(w(),s(d,{key:0,onNotify:n[1]||=t=>e.$emit(`resize`,t)})):c(``,!0)],64)):c(``,!0)],512),o(`div`,{ref:`arrow`,class:`v-popper__arrow-container`,style:S(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Dr,4)],4)],46,Cr)}const kr=dr(Sr,[[`render`,Or]]),Ar={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}};let jr=function(){};typeof window<`u`&&(jr=window.Element);const Mr=f({name:`VPopperWrapper`,components:{Popper:pr,PopperContent:kr},mixins:[Ar,xr(`finalTheme`)],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,jr,Boolean],default:void 0},boundary:{type:[String,jr],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function Nr(e,t,n,r,i,a){let o=A(`PopperContent`),c=A(`Popper`);return w(),s(c,v({ref:`popper`},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||=()=>e.$emit(`show`),onHide:t[1]||=()=>e.$emit(`hide`),"onUpdate:shown":t[2]||=t=>e.$emit(`update:shown`,t),onApplyShow:t[3]||=()=>e.$emit(`apply-show`),onApplyHide:t[4]||=()=>e.$emit(`apply-hide`),onCloseGroup:t[5]||=()=>e.$emit(`close-group`),onCloseDirective:t[6]||=()=>e.$emit(`close-directive`),onAutoHide:t[7]||=()=>e.$emit(`auto-hide`),onResize:t[8]||=()=>e.$emit(`resize`)}),{default:P(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,show:s,hide:c,handleResize:l,onResize:u,classes:f,result:p})=>[k(e.$slots,`default`,{shown:n,show:s,hide:c}),d(o,{ref:`popperContent`,"popper-id":t,theme:e.finalTheme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":l,classes:f,result:p,onHide:c,onResize:u},{default:P(()=>[k(e.$slots,`popper`,{shown:n,hide:c})]),_:2},1032,[`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:3},16,[`theme`,`target-nodes`,`popper-node`,`class`])}const Pr=dr(Mr,[[`render`,Nr]]),Fr={...Pr,name:`VDropdown`,vPopperTheme:`dropdown`},Ir={...Pr,name:`VMenu`,vPopperTheme:`menu`},Lr={...Pr,name:`VTooltip`,vPopperTheme:`tooltip`},Rr=f({name:`VTooltipDirective`,components:{Popper:er(),PopperContent:kr},mixins:[Ar],inheritAttrs:!1,props:{theme:{type:String,default:`tooltip`},html:{type:Boolean,default:e=>Bn(e.theme,`html`)},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>Bn(e.theme,`loadingContent`)},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content==`function`},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content==`function`&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;let e=++this.$_fetchId,t=this.content(this);t.then?t.then(t=>this.onResult(e,t)):this.onResult(e,t)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),zr=[`innerHTML`],Br=[`textContent`];function Vr(e,t,n,r,i,a){let o=A(`PopperContent`),c=A(`Popper`);return w(),s(c,v({ref:`popper`},e.$attrs,{theme:e.theme,"target-nodes":e.targetNodes,"popper-node":()=>e.$refs.popperContent.$el,onApplyShow:e.onShow,onApplyHide:e.onHide}),{default:P(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,hide:s,handleResize:c,onResize:u,classes:f,result:p})=>[d(o,{ref:`popperContent`,class:b({"v-popper--tooltip-loading":e.loading}),"popper-id":t,theme:e.theme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":c,classes:f,result:p,onHide:s,onResize:u},{default:P(()=>[e.html?(w(),l(`div`,{key:0,innerHTML:e.finalContent},null,8,zr)):(w(),l(`div`,{key:1,textContent:j(e.finalContent)},null,8,Br))]),_:2},1032,[`class`,`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:1},16,[`theme`,`target-nodes`,`popper-node`,`onApplyShow`,`onApplyHide`])}const Hr=dr(Rr,[[`render`,Vr]]),Ur=`v-popper--has-tooltip`;function Wr(e,t){let n=e.placement;if(!n&&t)for(let e of Gn)t[e]&&(n=e);return n||=Bn(e.theme||`tooltip`,`placement`),n}function Gr(e,t,n){let r,i=typeof t;return r=i===`string`?{content:t}:t&&i===`object`?t:{content:!1},r.placement=Wr(r,n),r.targetNodes=()=>[e],r.referenceNode=()=>e,r}let Kr,qr,Jr=0;function Yr(){if(Kr)return;qr=D([]),Kr=a({name:`VTooltipDirectiveApp`,setup(){return{directives:qr}},render(){return this.directives.map(e=>h(Hr,{...e.options,shown:e.shown||e.options.shown,key:e.id}))},devtools:{hide:!0}});let e=document.createElement(`div`);document.body.appendChild(e),Kr.mount(e)}function Xr(e,t,n){Yr();let r=D(Gr(e,t,n)),i=D(!1),a={id:Jr++,options:r,shown:i};return qr.value.push(a),e.classList&&e.classList.add(Ur),e.$_popper={options:r,item:a,show(){i.value=!0},hide(){i.value=!1}}}function Zr(e){if(e.$_popper){let t=qr.value.indexOf(e.$_popper.item);t!==-1&&qr.value.splice(t,1),delete e.$_popper,delete e.$_popperOldShown,delete e.$_popperMountTarget}e.classList&&e.classList.remove(Ur)}function Qr(e,{value:t,modifiers:n}){let r=Gr(e,t,n);if(!r.content||Bn(r.theme||`tooltip`,`disabled`))Zr(e);else{let i;e.$_popper?(i=e.$_popper,i.options.value=r):i=Xr(e,t,n),typeof t.shown<`u`&&t.shown!==e.$_popperOldShown&&(e.$_popperOldShown=t.shown,t.shown?i.show():i.hide())}}const $r={beforeMount:Qr,updated:Qr,beforeUnmount(e){Zr(e)}};function ei(e){e.addEventListener(`mousedown`,ni),e.addEventListener(`click`,ni),e.addEventListener(`touchstart`,ri,Un?{passive:!0}:!1)}function ti(e){e.removeEventListener(`mousedown`,ni),e.removeEventListener(`click`,ni),e.removeEventListener(`touchstart`,ri),e.removeEventListener(`touchend`,ii),e.removeEventListener(`touchcancel`,ai)}function ni(e){let t=e.currentTarget;e.closePopover=!t.$_vclosepopover_touch,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}function ri(e){if(e.changedTouches.length===1){let t=e.currentTarget;t.$_vclosepopover_touch=!0;let n=e.changedTouches[0];t.$_vclosepopover_touchPoint=n,t.addEventListener(`touchend`,ii),t.addEventListener(`touchcancel`,ai)}}function ii(e){let t=e.currentTarget;if(t.$_vclosepopover_touch=!1,e.changedTouches.length===1){let n=e.changedTouches[0],r=t.$_vclosepopover_touchPoint;e.closePopover=Math.abs(n.screenY-r.screenY)<20&&Math.abs(n.screenX-r.screenX)<20,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}}function ai(e){let t=e.currentTarget;t.$_vclosepopover_touch=!1}const oi={beforeMount(e,{value:t,modifiers:n}){e.$_closePopoverModifiers=n,(typeof t>`u`||t)&&ei(e)},updated(e,{value:t,oldValue:n,modifiers:r}){e.$_closePopoverModifiers=r,t!==n&&(typeof t>`u`||t?ei(e):ti(e))},beforeUnmount(e){ti(e)}},si=J,ci=$r,li=$r,ui=oi,di=oi,fi=Fr,pi=Ir,mi=er,hi=kr,gi=Ar,_i=Pr,vi=xr,yi=Lr,bi=Hr,xi={class:`flex-1 truncate`},Si={class:`min-w-[160px] flex flex-col gap-0.5 border border-neutral-200 rounded-lg bg-white p-1 shadow-lg dark:border-neutral-800 dark:bg-neutral-900`},Ci=[`onClick`];var wi=f({__name:`Select`,props:_({options:null,placeholder:null,disabled:{type:Boolean},title:null},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=e,r=N(e,`modelValue`),a=i(()=>{let e=n.options.find(e=>e.value===r.value);return e?e.label:n.placeholder});function c(e){r.value=e}return(e,i)=>(w(),s(M(fi),{"auto-size":``,"auto-boundary-max-size":``},{popper:P(({hide:i})=>[o(`div`,Si,[(w(!0),l(t,null,O(n.options,t=>(w(),l(`div`,v({ref_for:!0},{...e.$attrs,class:null,style:null},{key:t.value,class:[`cursor-pointer rounded px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800`,{"bg-neutral-100 dark:bg-neutral-800":r.value===t.value}],onClick:e=>{c(t.value),i()}}),j(t.label),17,Ci))),128))])]),default:P(()=>[o(`div`,{class:b([`min-w-[160px] flex cursor-pointer items-center justify-between gap-2 border rounded-lg bg-white p-2.5 text-xs text-neutral-700 shadow-sm outline-none transition-colors disabled:cursor-not-allowed dark:border-neutral-800 dark:bg-neutral-900 disabled:bg-neutral-100 hover:bg-neutral-50 dark:text-neutral-200 disabled:text-neutral-400 focus:ring-2 focus:ring-black/10 dark:disabled:bg-neutral-800 dark:hover:bg-neutral-800 dark:disabled:text-neutral-600`,{"pointer-events-none":n.disabled}])},[o(`div`,xi,[k(e.$slots,`default`,{label:a.value},()=>[u(j(a.value),1)])]),i[0]||=o(`div`,{"i-solar:alt-arrow-down-bold-duotone":``,class:`h-3.5 w-3.5 text-neutral-500 dark:text-neutral-400`},null,-1)],2)]),_:3}))}}),Ti=wi;export{dn as ColorHueRange_default,_t as FieldCheckbox_default,Ot as FieldInput_default,Bt as FieldKeyValues_default,Qt as FieldRange_default,cn as FieldValues_default,bt as Input_default,Ti as Select_default,Ie as arrow,Pe as computePosition,ve as createCoords,ze as flip,_e as floor,He as hide,Ke as limitShift,I as max,he as min,We as offset,V as rectToClientRect,ge as round,Ge as shift,qe as size}; \ No newline at end of file diff --git a/assets/stage-Dp_65zGQ.js b/assets/stage-ClK_9YgL.js similarity index 87% rename from assets/stage-Dp_65zGQ.js rename to assets/stage-ClK_9YgL.js index 66fc21e48f6dd4acaea5b4272fd4cb585d9aab07..8a5ef0315ac5456d27b38d95739a24289e61ec06 100644 --- a/assets/stage-Dp_65zGQ.js +++ b/assets/stage-ClK_9YgL.js @@ -1 +1 @@ -import{createElementBlock as e,createVNode as t,defineComponent as n,normalizeStyle as r,openBlock as i,resolveComponent as a,unref as o,useScreenSafeArea as s}from"./index-BSwg6FIo.js";var c=n({__name:`stage`,setup(n){let{top:c,right:l,bottom:u,left:d}=s();return(n,s)=>{let f=a(`RouterView`);return i(),e(`main`,{text:`gray-700 dark:gray-200`,"h-full":``,"font-cuteen":``,style:r({paddingTop:`${o(c)}px`,paddingRight:`${o(l)}px`,paddingBottom:`${o(u)}px`,paddingLeft:`${o(d)}px`})},[t(f)],4)}}}),l=c;export{l as default}; \ No newline at end of file +import{createElementBlock as e,createVNode as t,defineComponent as n,normalizeStyle as r,openBlock as i,resolveComponent as a,unref as o,useScreenSafeArea as s}from"./index-DKziOBM4.js";var c=n({__name:`stage`,setup(n){let{top:c,right:l,bottom:u,left:d}=s();return(n,s)=>{let f=a(`RouterView`);return i(),e(`main`,{text:`gray-700 dark:gray-200`,"h-full":``,"font-cuteen":``,style:r({paddingTop:`${o(c)}px`,paddingRight:`${o(l)}px`,paddingBottom:`${o(u)}px`,paddingLeft:`${o(d)}px`})},[t(f)],4)}}}),l=c;export{l as default}; \ No newline at end of file diff --git a/assets/stage-BkAPr8zf.js b/assets/stage-rGESOq2q.js similarity index 96% rename from assets/stage-BkAPr8zf.js rename to assets/stage-rGESOq2q.js index 2455af1aed35e5d2c7b646eaef1cae0c3941d6dd..6b7280c4260b6a2e05e69ffaf27596446d2832c2 100644 --- a/assets/stage-BkAPr8zf.js +++ b/assets/stage-rGESOq2q.js @@ -1,3 +1,3 @@ -import{Fragment as e,RouterLink as t,__plugin_vue_export_helper_default as n,computed as r,createBaseVNode as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createVNode as c,defineComponent as l,nextTick as u,normalizeClass as d,normalizeStyle as f,onMounted as p,openBlock as m,ref as h,renderList as g,renderSlot as _,resolveDirective as v,storeToRefs as y,toDisplayString as b,unref as x,useDark as S,useDevicesList as C,useElementBounding as w,useI18n as T,useMouse as E,useScroll as D,useSettings as O,vModelCheckbox as ee,vModelRadio as k,watch as A,withCtx as j,withDirectives as M}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useAudioContext as te,useChatStore as N,useConsciousnessStore as P,useProvidersStore as F}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import{HeaderLink_default as I}from"./HeaderLink-rfbghXs_.js";import{TransitionVertical_default as ne}from"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{Basic_default as L}from"./Basic-BGRWPjtG.js";import{Stage_default as R}from"./components-DetbLrEi.js";import{useMarkdown as z,useMicVAD as B,useWhisper as re}from"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as V}from"./route-block-CC3cgg4Q.js";const H={},U={class:`cross-background-container`};function W(e,t){return m(),s(`div`,U,[_(e.$slots,`default`,{},void 0,!0)])}var G=n(H,[[`render`,W],[`__scopeId`,`data-v-455eb62c`]]);const K={"mb-1":``,"w-full":``,"gap-2":``},q={"w-full":``};var J=l({__name:`Header`,setup(e){return(e,n)=>(m(),s(`header`,K,[i(`div`,q,[c(I)]),c(x(t),{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:j(()=>n[0]||=[i(`div`,{"i-solar:settings-minimalistic-bold-duotone":``},null,-1)]),_:1,__:[0]})]))}}),Y=J,ie=`/assets/worker-Bq31kV70.js`;async function ae(e,t){let n=new ArrayBuffer(44+e.length*2),r=new DataView(n);X(r,0,`RIFF`),r.setUint32(4,36+e.length*2,!0),X(r,8,`WAVE`),X(r,12,`fmt `),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,t,!0),r.setUint32(28,t*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),X(r,36,`data`),r.setUint32(40,e.length*2,!0),Z(r,44,e);let i=new Blob([r],{type:`audio/wav`});return new Promise((e,t)=>{let n=new FileReader;n.onload=()=>{let t=n.result.split(`,`)[1];e(t)},n.onerror=t,n.readAsDataURL(i)})}function X(e,t,n){for(let r=0;r{u().then(()=>{c.update(),l.value=c.height.value})}),_(async()=>{u().then(()=>{c.update(),l.value=c.height.value})}),(t,c)=>{let l=v(`auto-animate`);return m(),s(`div`,oe,[c[2]||=i(`div`,{"flex-1":``},null,-1),M((m(),s(`div`,{ref_key:`chatHistoryRef`,ref:n,"h-full":``,"w-full":``,flex:`~ col`,"overflow-scroll":``},[c[1]||=i(`div`,{"flex-1":``},null,-1),(m(!0),s(e,null,g(x(r),(e,t)=>(m(),s(`div`,{key:t,"mb-2":``},[e.role===`error`?(m(),s(`div`,se,[i(`div`,ce,[i(`div`,le,[i(`div`,ue,[i(`span`,de,b(x(d)(`stage.chat.message.character-name.core-system`)),1)]),c[0]||=i(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),x(a)&&t===x(r).length-1?(m(),s(`div`,fe)):(m(),s(`div`,{key:1,class:`markdown-content break-words text-violet-500`,text:`base {if(!e||!e.trim())return;let t=f.getProviderConfig(_.value);await z(e,{chatProvider:f.getProviderInstance(_.value),model:v.value,providerConfig:t})}});async function q(){if(!(!n.value.trim()||u.value))try{let e=f.getProviderConfig(_.value);await z(n.value,{chatProvider:f.getProviderInstance(_.value),model:v.value,providerConfig:e})}catch(e){H.value.pop(),H.value.push({role:`error`,content:e.message})}}let{destroy:J,start:Y}=B(R,{onSpeechStart:()=>{r.value=!0},onVADMisfire:()=>{r.value=!1},onSpeechEnd:e=>{r.value=!1,X(e)},auto:!1});async function X(e){await U.resume();let t=await ae(e,U.sampleRate);G({type:`generate`,data:{audio:t,language:`en`}})}async function Z(e){let t=e.target,n=w.value.find(e=>e.deviceId===t.value);if(!n){D.value=void 0;return}D.value=n}return A(I,async e=>{e===`false`&&(J(),K())}),A(l,async e=>{e&&await E()}),p(()=>{Y()}),V(async()=>{n.value=``}),(t,f)=>(m(),s(`div`,Ee,[i(`fieldset`,De,[i(`label`,{class:d([a.value===`chat`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,a.value===`chat`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":x(S)}]),flex:`~ row`,checked:a.value===`chat`,"aria-checked":a.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":``},[M(i(`input`,{"onUpdate:modelValue":f[0]||=e=>a.value=e,type:`radio`,name:`tab`,value:`chat`,hidden:``},null,512),[[k,a.value]]),f[7]||=i(`div`,{"i-solar:dialog-2-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),i(`div`,ke,[i(`span`,Ae,b(x(W)(`stage.chat.tabs.chat`)),1)])],10,Oe),i(`label`,{class:d([a.value===`custom`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,a.value===`custom`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":x(S)}]),flex:`~ row`,checked:a.value===`custom`,"aria-checked":a.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":``},[M(i(`input`,{"onUpdate:modelValue":f[1]||=e=>a.value=e,type:`radio`,name:`tab`,value:`custom`,hidden:``},null,512),[[k,a.value]]),f[8]||=i(`div`,{"i-solar:star-fall-2-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),i(`div`,Me,[i(`span`,null,b(x(W)(`stage.chat.tabs.custom`)),1)])],10,je),i(`label`,{class:d([a.value===`clothes`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,a.value===`clothes`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":x(S)}]),flex:`~ row`,checked:a.value===`clothes`,"aria-checked":a.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":``},[M(i(`input`,{"onUpdate:modelValue":f[2]||=e=>a.value=e,type:`radio`,name:`tab`,value:`clothes`,hidden:``},null,512),[[k,a.value]]),f[9]||=i(`div`,{"i-solar:magic-stick-3-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),i(`div`,Pe,[i(`span`,null,b(x(W)(`stage.chat.tabs.clothes`)),1)])],10,Ne)]),i(`div`,Fe,[i(`div`,Ie,[c(Te,{"h-full":``,"flex-1":``,"p-4":``,w:`full`,"max-h":`n.value=e,placeholder:x(W)(`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:d({"transition-colors-none placeholder:transition-colors-none":x(S)}),onSubmit:q,onCompositionstart:f[4]||=e=>u.value=!0,onCompositionend:f[5]||=e=>u.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])]),i(`div`,Re,[i(`div`,ze,[c(x(ne),null,{default:j(()=>[l.value?(m(),s(`fieldset`,Be,[(m(!0),s(e,null,g(x(w),(e,t)=>(m(),s(`label`,{key:t,class:`[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900`},[i(`input`,{type:`radio`,name:`audioInput`,value:e.deviceId,hidden:``,onChange:Z},null,40,Ve),i(`div`,He,[i(`div`,Ue,[e.deviceId===x(R)?(m(),s(`div`,We)):o(``,!0)]),i(`span`,{"inline-block":``,class:d([e.deviceId===x(R)?`cyan-400 dark:text-white`:`cyan-400/50 dark:text-white/50`]),transition:`all duration-250 ease-in-out`},b(e.label),3)])]))),128))])):o(``,!0)]),_:1}),i(`label`,{bg:`complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700`,transition:`all duration-250 ease-in-out`,class:d({"transition-colors-none":x(S)}),text:`complementary-400`,"h-fit":``,flex:``,"cursor-pointer":``,"items-center":``,"justify-center":``,"gap-2":``,"rounded-full":``,"px-4":``,"py-2":``},[M(i(`input`,{"onUpdate:modelValue":f[6]||=e=>l.value=e,type:`checkbox`,hidden:``},null,512),[[ee,l.value]]),f[10]||=i(`div`,{"i-solar:microphone-2-bold-duotone":``},null,-1),i(`div`,null,[r.value?(m(),s(`span`,Ke,`Listening...`)):(m(),s(`span`,Ge,b(x(W)(`settings.microphone`)),1))])],2)])])]))}}),Je=n(qe,[[`__scopeId`,`data-v-5b585ca8`]]);const Ye={py:`1`,flex:`~ col`,rounded:`lg`,"overflow-hidden":``},Xe={key:0,flex:``,mr:`12`},Ze={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":``,"backdrop-blur-sm":``,h:`unset {u().then(()=>{c.update(),l.value=c.height.value})}),p(async()=>{u().then(()=>{c.update(),l.value=c.height.value})}),(t,c)=>{let l=v(`auto-animate`);return m(),s(`div`,Ye,[c[1]||=i(`div`,{"flex-1":``},null,-1),M((m(),s(`div`,{ref_key:`chatHistoryRef`,ref:n,"h-full":``,"w-full":``,"max-h":`30vh`,flex:`~ col`,"overflow-scroll":``,class:`chat-history`},[c[0]||=i(`div`,{"flex-1":``},null,-1),(m(!0),s(e,null,g(x(a),(e,t)=>(m(),s(`div`,{key:t,"mb-2":``},[e.role===`assistant`?(m(),s(`div`,Xe,[i(`div`,Ze,[i(`div`,null,[i(`span`,Qe,b(x(r)(`stage.chat.message.character-name.airi`)),1)]),e.content?(m(),s(`div`,{key:0,class:`markdown-content`,text:`base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:e=>{n.value=!1,E(e)},auto:!1});function E(e){alert(`Transcription is not implemented yet`)}return A(u,async e=>{e===`false`&&C()}),v(async()=>{t.value=``}),p(()=>{w()}),(e,n)=>(m(),s(`div`,null,[i(`div`,st,[c(ot,{absolute:``,"left-0":``,"top-0":``,transform:`translate-y-[-100%]`,"w-full":``}),i(`div`,ct,[c(x(L),{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,placeholder:x(b)(`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:d({"transition-colors-none placeholder:transition-colors-none":x(g)}),onSubmit:S,onCompositionstart:n[1]||=e=>r.value=!0,onCompositionend:n[2]||=e=>r.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])]))}}),ut=lt;const dt={class:`relative`},ft={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``};var pt=l({__name:`AnimatedWave`,props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:`oklch(95% 0.10 var(--chromatic-hue))`},direction:{default:`down`},movementDirection:{default:`left`},animationSpeed:{default:50}},setup(e){let t=e,n=h(t.height),a=h(t.amplitude),o=h(t.waveLength),c=h(t.fillColor),l=h(t.direction),u=h(t.movementDirection);function d(e,t,n,r,i){let a=[],o=Math.ceil(e/r),s=o*r,c=1,l=i===`up`?n:t-n;a.push(`M 0 ${l}`);let u=Math.PI*2/r;for(let e=0;e<=s;e+=c){let t=n*Math.sin(u*e),r=i===`up`?l-t:l+t;a.push(`L ${e} ${r}`)}let d=i===`up`?t:0;return a.push(`L ${s} ${d}`),a.push(`L 0 ${d} Z`),a.join(` `)}let p=r(()=>n.value+a.value*2),g=r(()=>{let e=` +import{Fragment as e,RouterLink as t,__plugin_vue_export_helper_default as n,computed as r,createBaseVNode as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createVNode as c,defineComponent as l,nextTick as u,normalizeClass as d,normalizeStyle as f,onMounted as p,openBlock as m,ref as h,renderList as g,renderSlot as _,resolveDirective as v,storeToRefs as y,toDisplayString as b,unref as x,useDark as S,useDevicesList as C,useElementBounding as w,useI18n as T,useMouse as E,useScroll as D,useSettings as O,vModelCheckbox as ee,vModelRadio as k,watch as A,withCtx as j,withDirectives as M}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useAudioContext as te,useChatStore as N,useConsciousnessStore as P,useProvidersStore as F}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import{HeaderLink_default as I}from"./HeaderLink-vGMDgqa7.js";import{TransitionVertical_default as ne}from"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{Basic_default as L}from"./Basic-C8g-kAol.js";import{Stage_default as R}from"./components-BvWgWMX4.js";import{useMarkdown as z,useMicVAD as B,useWhisper as re}from"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as V}from"./route-block-CC3cgg4Q.js";const H={},U={class:`cross-background-container`};function W(e,t){return m(),s(`div`,U,[_(e.$slots,`default`,{},void 0,!0)])}var G=n(H,[[`render`,W],[`__scopeId`,`data-v-455eb62c`]]);const K={"mb-1":``,"w-full":``,"gap-2":``},q={"w-full":``};var J=l({__name:`Header`,setup(e){return(e,n)=>(m(),s(`header`,K,[i(`div`,q,[c(I)]),c(x(t),{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:j(()=>n[0]||=[i(`div`,{"i-solar:settings-minimalistic-bold-duotone":``},null,-1)]),_:1,__:[0]})]))}}),Y=J,ie=`/assets/worker-Bq31kV70.js`;async function ae(e,t){let n=new ArrayBuffer(44+e.length*2),r=new DataView(n);X(r,0,`RIFF`),r.setUint32(4,36+e.length*2,!0),X(r,8,`WAVE`),X(r,12,`fmt `),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,t,!0),r.setUint32(28,t*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),X(r,36,`data`),r.setUint32(40,e.length*2,!0),Z(r,44,e);let i=new Blob([r],{type:`audio/wav`});return new Promise((e,t)=>{let n=new FileReader;n.onload=()=>{let t=n.result.split(`,`)[1];e(t)},n.onerror=t,n.readAsDataURL(i)})}function X(e,t,n){for(let r=0;r{u().then(()=>{c.update(),l.value=c.height.value})}),_(async()=>{u().then(()=>{c.update(),l.value=c.height.value})}),(t,c)=>{let l=v(`auto-animate`);return m(),s(`div`,oe,[c[2]||=i(`div`,{"flex-1":``},null,-1),M((m(),s(`div`,{ref_key:`chatHistoryRef`,ref:n,"h-full":``,"w-full":``,flex:`~ col`,"overflow-scroll":``},[c[1]||=i(`div`,{"flex-1":``},null,-1),(m(!0),s(e,null,g(x(r),(e,t)=>(m(),s(`div`,{key:t,"mb-2":``},[e.role===`error`?(m(),s(`div`,se,[i(`div`,ce,[i(`div`,le,[i(`div`,ue,[i(`span`,de,b(x(d)(`stage.chat.message.character-name.core-system`)),1)]),c[0]||=i(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),x(a)&&t===x(r).length-1?(m(),s(`div`,fe)):(m(),s(`div`,{key:1,class:`markdown-content break-words text-violet-500`,text:`base {if(!e||!e.trim())return;let t=f.getProviderConfig(_.value);await z(e,{chatProvider:f.getProviderInstance(_.value),model:v.value,providerConfig:t})}});async function q(){if(!(!n.value.trim()||u.value))try{let e=f.getProviderConfig(_.value);await z(n.value,{chatProvider:f.getProviderInstance(_.value),model:v.value,providerConfig:e})}catch(e){H.value.pop(),H.value.push({role:`error`,content:e.message})}}let{destroy:J,start:Y}=B(R,{onSpeechStart:()=>{r.value=!0},onVADMisfire:()=>{r.value=!1},onSpeechEnd:e=>{r.value=!1,X(e)},auto:!1});async function X(e){await U.resume();let t=await ae(e,U.sampleRate);G({type:`generate`,data:{audio:t,language:`en`}})}async function Z(e){let t=e.target,n=w.value.find(e=>e.deviceId===t.value);if(!n){D.value=void 0;return}D.value=n}return A(I,async e=>{e===`false`&&(J(),K())}),A(l,async e=>{e&&await E()}),p(()=>{Y()}),V(async()=>{n.value=``}),(t,f)=>(m(),s(`div`,Ee,[i(`fieldset`,De,[i(`label`,{class:d([a.value===`chat`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,a.value===`chat`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":x(S)}]),flex:`~ row`,checked:a.value===`chat`,"aria-checked":a.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":``},[M(i(`input`,{"onUpdate:modelValue":f[0]||=e=>a.value=e,type:`radio`,name:`tab`,value:`chat`,hidden:``},null,512),[[k,a.value]]),f[7]||=i(`div`,{"i-solar:dialog-2-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),i(`div`,ke,[i(`span`,Ae,b(x(W)(`stage.chat.tabs.chat`)),1)])],10,Oe),i(`label`,{class:d([a.value===`custom`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,a.value===`custom`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":x(S)}]),flex:`~ row`,checked:a.value===`custom`,"aria-checked":a.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":``},[M(i(`input`,{"onUpdate:modelValue":f[1]||=e=>a.value=e,type:`radio`,name:`tab`,value:`custom`,hidden:``},null,512),[[k,a.value]]),f[8]||=i(`div`,{"i-solar:star-fall-2-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),i(`div`,Me,[i(`span`,null,b(x(W)(`stage.chat.tabs.custom`)),1)])],10,je),i(`label`,{class:d([a.value===`clothes`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,a.value===`clothes`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":x(S)}]),flex:`~ row`,checked:a.value===`clothes`,"aria-checked":a.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":``},[M(i(`input`,{"onUpdate:modelValue":f[2]||=e=>a.value=e,type:`radio`,name:`tab`,value:`clothes`,hidden:``},null,512),[[k,a.value]]),f[9]||=i(`div`,{"i-solar:magic-stick-3-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),i(`div`,Pe,[i(`span`,null,b(x(W)(`stage.chat.tabs.clothes`)),1)])],10,Ne)]),i(`div`,Fe,[i(`div`,Ie,[c(Te,{"h-full":``,"flex-1":``,"p-4":``,w:`full`,"max-h":`n.value=e,placeholder:x(W)(`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:d({"transition-colors-none placeholder:transition-colors-none":x(S)}),onSubmit:q,onCompositionstart:f[4]||=e=>u.value=!0,onCompositionend:f[5]||=e=>u.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])]),i(`div`,Re,[i(`div`,ze,[c(x(ne),null,{default:j(()=>[l.value?(m(),s(`fieldset`,Be,[(m(!0),s(e,null,g(x(w),(e,t)=>(m(),s(`label`,{key:t,class:`[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900`},[i(`input`,{type:`radio`,name:`audioInput`,value:e.deviceId,hidden:``,onChange:Z},null,40,Ve),i(`div`,He,[i(`div`,Ue,[e.deviceId===x(R)?(m(),s(`div`,We)):o(``,!0)]),i(`span`,{"inline-block":``,class:d([e.deviceId===x(R)?`cyan-400 dark:text-white`:`cyan-400/50 dark:text-white/50`]),transition:`all duration-250 ease-in-out`},b(e.label),3)])]))),128))])):o(``,!0)]),_:1}),i(`label`,{bg:`complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700`,transition:`all duration-250 ease-in-out`,class:d({"transition-colors-none":x(S)}),text:`complementary-400`,"h-fit":``,flex:``,"cursor-pointer":``,"items-center":``,"justify-center":``,"gap-2":``,"rounded-full":``,"px-4":``,"py-2":``},[M(i(`input`,{"onUpdate:modelValue":f[6]||=e=>l.value=e,type:`checkbox`,hidden:``},null,512),[[ee,l.value]]),f[10]||=i(`div`,{"i-solar:microphone-2-bold-duotone":``},null,-1),i(`div`,null,[r.value?(m(),s(`span`,Ke,`Listening...`)):(m(),s(`span`,Ge,b(x(W)(`settings.microphone`)),1))])],2)])])]))}}),Je=n(qe,[[`__scopeId`,`data-v-5b585ca8`]]);const Ye={py:`1`,flex:`~ col`,rounded:`lg`,"overflow-hidden":``},Xe={key:0,flex:``,mr:`12`},Ze={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":``,"backdrop-blur-sm":``,h:`unset {u().then(()=>{c.update(),l.value=c.height.value})}),p(async()=>{u().then(()=>{c.update(),l.value=c.height.value})}),(t,c)=>{let l=v(`auto-animate`);return m(),s(`div`,Ye,[c[1]||=i(`div`,{"flex-1":``},null,-1),M((m(),s(`div`,{ref_key:`chatHistoryRef`,ref:n,"h-full":``,"w-full":``,"max-h":`30vh`,flex:`~ col`,"overflow-scroll":``,class:`chat-history`},[c[0]||=i(`div`,{"flex-1":``},null,-1),(m(!0),s(e,null,g(x(a),(e,t)=>(m(),s(`div`,{key:t,"mb-2":``},[e.role===`assistant`?(m(),s(`div`,Xe,[i(`div`,Ze,[i(`div`,null,[i(`span`,Qe,b(x(r)(`stage.chat.message.character-name.airi`)),1)]),e.content?(m(),s(`div`,{key:0,class:`markdown-content`,text:`base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:e=>{n.value=!1,E(e)},auto:!1});function E(e){alert(`Transcription is not implemented yet`)}return A(u,async e=>{e===`false`&&C()}),v(async()=>{t.value=``}),p(()=>{w()}),(e,n)=>(m(),s(`div`,null,[i(`div`,st,[c(ot,{absolute:``,"left-0":``,"top-0":``,transform:`translate-y-[-100%]`,"w-full":``}),i(`div`,ct,[c(x(L),{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,placeholder:x(b)(`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:d({"transition-colors-none placeholder:transition-colors-none":x(g)}),onSubmit:S,onCompositionstart:n[1]||=e=>r.value=!0,onCompositionend:n[2]||=e=>r.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])]))}}),ut=lt;const dt={class:`relative`},ft={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``};var pt=l({__name:`AnimatedWave`,props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:`oklch(95% 0.10 var(--chromatic-hue))`},direction:{default:`down`},movementDirection:{default:`left`},animationSpeed:{default:50}},setup(e){let t=e,n=h(t.height),a=h(t.amplitude),o=h(t.waveLength),c=h(t.fillColor),l=h(t.direction),u=h(t.movementDirection);function d(e,t,n,r,i){let a=[],o=Math.ceil(e/r),s=o*r,c=1,l=i===`up`?n:t-n;a.push(`M 0 ${l}`);let u=Math.PI*2/r;for(let e=0;e<=s;e+=c){let t=n*Math.sin(u*e),r=i===`up`?l-t:l+t;a.push(`L ${e} ${r}`)}let d=i===`up`?t:0;return a.push(`L ${s} ${d}`),a.push(`L 0 ${d} Z`),a.join(` `)}let p=r(()=>n.value+a.value*2),g=r(()=>{let e=` `;return`url(data:image/svg+xml;base64,${btoa(e)})`});return A(()=>[t.height,t.amplitude,t.waveLength,t.fillColor,t.direction,t.movementDirection],()=>{n.value=t.height,a.value=t.amplitude,o.value=t.waveLength,c.value=t.fillColor,l.value=t.direction,u.value=t.movementDirection},{immediate:!0}),(t,n)=>(m(),s(`div`,dt,[_(t.$slots,`default`,{},void 0,!0),i(`div`,ft,[i(`div`,{class:`wave`,style:f({background:c.value,height:`${p.value}px`,maskImage:g.value,WebkitMaskImage:g.value,"--wave-translate":`${-o.value}px`,"--animation-duration":`${o.value/e.animationSpeed}s`,"animation-direction":u.value===`left`?`normal`:`reverse`})},null,4)])]))}}),mt=n(pt,[[`__scopeId`,`data-v-f58b462e`]]);const ht={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},gt={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 (m(),a(G,null,{default:j(()=>[c(mt,{"fill-color":x(t)?`oklch(35% calc(var(--chromatic-chroma) * 0.6) var(--chromatic-hue))`:`color-mix(in srgb, oklch(95% calc(var(--chromatic-chroma-50) * 0.5) var(--chromatic-hue)) 80%, oklch(100% 0 360))`},{default:j(()=>[i(`div`,ht,[i(`div`,null,[c(Y,{class:`flex`,p2:``})]),i(`div`,gt,[c(x(R),{"flex-1":``,"min-w":`1/2`,paused:n.value,"focus-at":{x:x(o).x.value,y:x(o).y.value}},null,8,[`paused`,`focus-at`]),c(Je,{class:`flex e**1.2).map(e=>e*1.2).reduce((e,t)=>e+t,0);return r/t.length/100}function ae(e){let t=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(t);let n=[];for(let e=0;e<700;e+=80)n.push(t[e]);let r=t.map(e=>e**1.5),i=Math.min(...r),a=Math.max(...r),o=a-i,s;s=o===0?r.map(()=>0):r.map(e=>(e-i)/o);let c=s.reduce((e,t)=>e+t,0);return c/t.length}function oe(e,t=`linear`){switch(t){case`linear`:return ie(e);case`minmax`:return ae(e)}}const se=i(`AudioContext`,()=>{let e=new AudioContext;return{audioContext:e,calculateVolume:oe}}),ce=i(`SpeakingStore`,()=>{let e=30,t=100,r=s(0),i=s(!1),a=n(()=>i.value?(e+(t-e)*r.value)/100:e);return{mouthOpenSize:r,nowSpeaking:i,nowSpeakingAvatarBorderOpacity:a}}),j=async e=>(e.fetch??globalThis.fetch)(A(`models`,e.baseURL),{headers:k(e.headers,e.apiKey),signal:e.abortSignal}).then(te).then(({data:e})=>e),M=async({description:e,execute:t,name:n,parameters:r})=>{let i=await p(r);return{execute:t,function:{description:e,name:n,parameters:{...i,additionalProperties:!1},strict:!0},type:`function`}},le=[M({name:`debug_random_number`,description:`Generate a random number between 0 and 1`,execute:async()=>new Promise(e=>{setTimeout(()=>{e(Math.random().toString())},1e3)}),parameters:_({})})],ue=async()=>Promise.all(le);function N(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function P(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var F,I,L,R,de;const fe=`__TAURI_TO_IPC_KEY__`;function pe(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}var me=class{constructor(e){F.set(this,void 0),I.set(this,0),L.set(this,[]),R.set(this,void 0),P(this,F,e||(()=>{}),`f`),this.id=pe(e=>{let t=e.index;if(`end`in e){t==N(this,I,`f`)?this.cleanupCallback():P(this,R,t,`f`);return}let n=e.message;if(t==N(this,I,`f`)){for(N(this,F,`f`).call(this,n),P(this,I,N(this,I,`f`)+1,`f`);N(this,I,`f`)in N(this,L,`f`);){let e=N(this,L,`f`)[N(this,I,`f`)];N(this,F,`f`).call(this,e),delete N(this,L,`f`)[N(this,I,`f`)],P(this,I,N(this,I,`f`)+1,`f`)}N(this,I,`f`)===N(this,R,`f`)&&this.cleanupCallback()}else N(this,L,`f`)[t]=n})}cleanupCallback(){Reflect.deleteProperty(window,`_${this.id}`)}set onmessage(e){P(this,F,e,`f`)}get onmessage(){return N(this,F,`f`)}[(F=new WeakMap,I=new WeakMap,L=new WeakMap,R=new WeakMap,fe)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[fe]()}};async function z(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}de=new WeakMap;async function he(e,t){await z(`plugin:mcp|connect_server`,{command:e,args:t})}async function ge(){await z(`plugin:mcp|disconnect_server`)}async function _e(){return await z(`plugin:mcp|list_tools`)}async function ve(e,t){return await z(`plugin:mcp|call_tool`,{name:e,args:t})}const ye=[M({name:`mcp_list_tools`,description:`List all tools available on the MCP server`,execute:async(e,t)=>await _e(),parameters:_({})}),M({name:`mcp_connect_server`,description:`Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.`,execute:async({command:e,args:t})=>(await he(e,t),`success`),parameters:_({command:v().describe(`The command to connect to the MCP server`),args:m(v()).describe(`The arguments to pass to the MCP server`)})}),M({name:`mcp_disconnect_server`,description:`Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.`,execute:async()=>(await ge(),`success`),parameters:_({})}),M({name:`mcp_call_tool`,description:`Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.`,execute:async({name:e,parameters:t})=>{let n=Object.fromEntries(t.map(({name:e,value:t})=>[e,t])),r=await ve(e,n);return r},parameters:_({name:v().describe(`The name of the tool to call`),parameters:m(_({name:v().describe(`The name of the parameter`),value:y([v(),g(),h(),_({})]).describe(`The value of the parameter, it can be a string, a number, a boolean, or an object`)})).describe(`The parameters to pass to the tool`)})})],be=async()=>Promise.all(ye),xe=i(`llm`,()=>{async function e(e,t,n,r){let i=r?.headers;return await ne({...t.chat(e),maxSteps:10,messages:n.map(e=>({...e,content:e.role===`error`?`User encountered error: ${e.content}`:e.content,role:e.role===`error`?`user`:e.role})),headers:i,tools:[...await be(),...await ue()],onEvent(e){var t,n;e.type===`tool-call`?r==null||(t=r.onToolCall)==null||t.call(r,e.toolCall):e.type===`tool-call-result`&&(r==null||(n=r.onToolCallResult)==null||n.call(r,{id:e.id,result:e.result}))}})}async function t(e,t){if(e===``)return[];try{return await j({baseURL:e.endsWith(`/`)?e:`${e}/`,apiKey:t})}catch(e){if(String(e).includes(`Failed to construct 'URL': Invalid URL`))return[];throw e}}return{models:t,stream:e}}),B=e=>({chat:t=>Object.assign(e,{model:t})}),V=e=>({embed:t=>Object.assign(e,{model:t})}),Se=e=>({image:t=>Object.assign(e,{model:t})}),H=e=>({model:()=>e}),Ce=e=>({speech:t=>Object.assign(e,{model:t})}),we=e=>({transcription:t=>Object.assign(e,{model:t})}),U=(e,t)=>({metadata:{id:e,...t}}),W=(...e)=>Object.assign(e[0],...e.slice(1)),Te=(e,t=`https://api.anthropic.com/v1/`)=>W(U(`anthropic`),B({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t})),Ee=(e,t=`https://api.deepseek.com/`)=>W(U(`deepseek`),B({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t})),De=(e,t=`https://api.fireworks.ai/inference/v1/`)=>W(U(`fireworks`),B({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t})),Oe=(e,t=`https://generativelanguage.googleapis.com/v1beta/openai/`)=>W(U(`google-generative-ai`),B({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t})),ke=(e,t=`https://api.mistral.ai/v1/`)=>W(U(`mistral`),B({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t})),Ae=(e,t=`https://api.moonshot.cn/v1/`)=>W(U(`moonshot`),B({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t})),je=(e,t=`https://api.novita.ai/v3/openai/`)=>W(U(`novita`),B({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t})),G=(e,t=`https://api.openai.com/v1/`)=>W(U(`openai`),B({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t}),Se({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t}),Ce({apiKey:e,baseURL:t}),we({apiKey:e,baseURL:t})),Me=(e,t=``)=>W(U(`openrouter`),{chat:(n,r)=>{let i={apiKey:e,baseURL:t,model:n},a=({extraHeaders:e,models:t,provider:n})=>{e!=null&&(i.headers??={},Object.assign(i.headers,e));let r;return n!=null&&(r=D(n)),D({models:t,provider:r})};return{...r?a(r):{},...i}}},H({apiKey:e,baseURL:t})),Ne=(e,t=`https://api.perplexity.ai/`)=>W(U(`perplexity`),B({apiKey:e,baseURL:t})),Pe=(e,t=`https://api.together.xyz/v1/`)=>W(U(`together-ai`),B({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t,fetch:async(...e)=>globalThis.fetch(...e).then(async e=>e.json()).then(e=>Response.json({data:e,object:`list`}))})),Fe=(e,t)=>{let n=`https://api.cloudflare.com/client/v4/accounts/${t}/ai/v1/`;return W(U(`workers-ai`),B({apiKey:e,baseURL:n}),V({apiKey:e,baseURL:n}))},Ie=(e,t=`https://api.x.ai/v1/`)=>W(U(`xai`),B({apiKey:e,baseURL:t}),H({apiKey:e,baseURL:t}));var Le=t(b());const K=(e=`http://localhost:11434/v1/`)=>W(U(`ollama`),B({baseURL:e}),V({baseURL:e}),H({baseURL:e})),Re=(e=`http://localhost:4315/v1/`,t=`xsai`)=>W(U(`player2`),B({baseURL:e,headers:{"player2-game-key":t}}),Ce({baseURL:e,fetch:async(e,t)=>{let n=`${e.toString().slice(0,-12)}tts/speak`;try{let{input:e,response_format:n,speed:r,voice:i,...a}=JSON.parse(t?.body),o={audio_format:n,play_in_app:!1,speed:r??1,text:e,voice_ids:i==null?[]:[i],...a};t&&(t.body=JSON.stringify(o))}catch(e){console.warn(`Could not parse body as JSON:`,e)}return globalThis.fetch(n,t).then(async e=>e.json()).then(e=>{let t=e.data??``,n=Le.Buffer.from(t,`base64`).toString(`binary`),r=Uint8Array.from(Array.from(n,e=>e.charCodeAt(0)));for(let e=0;eObject.assign(e[0],...e.slice(1));var J=class extends Error{constructor(t,n){super(t),e.defineProperty(this,`response`,void 0),this.name=`XSAIError`,this.response=n}};const ze=e=>e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`),Y=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[ze(e),t])),Be=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),Ve=(e,t)=>Be({Authorization:t===void 0?void 0:`Bearer ${t}`,...e}),He=(e,t)=>{let n=t.toString();return new URL(e,n.endsWith(`/`)?n:`${n}/`)},Ue=async e=>{if(!e.ok)throw new J(`Remote sent ${e.status} response: ${await e.text()}`,e);if(!e.body)throw new J(`Response body is empty from remote server`,e);if(!(e.body instanceof ReadableStream))throw new J(`Expected Response body to be a ReadableStream, but got ${String(e.body)}; Content Type is ${e.headers.get(`Content-Type`)}`,e);return e},We=async e=>Ue(e).then(async e=>{let t=await e.text();try{return JSON.parse(t)}catch{throw Error(`Failed to parse response, response body: ${t}`)}});var Ge=(e,t=`http://localhost:5933/v1/`)=>{let n=({applyTextNormalization:e,languageCode:t,nextRequestIds:n,nextText:r,previousRequestIds:i,previousText:a,pronunciationDictionaryLocators:o,seed:s,voiceSettings:c})=>({extraBody:Y({applyTextNormalization:e,languageCode:t,nextRequestIds:n,nextText:r,previousRequestIds:i,previousText:a,pronunciationDictionaryLocators:o?o.map(e=>Y(e)):void 0,seed:s,voiceSettings:Y(c??{similarityBoost:.75,stability:.5})})}),r={speech:(r,i)=>({...i?n(i):{},apiKey:e,baseURL:t,model:`elevenlabs/${r}`})},i={voice:r=>(t.endsWith(`v1/`)?t=t.slice(0,-3):t.endsWith(`v1`)&&(t=t.slice(0,-2)),{query:`provider=elevenlabs`,...r?n(r):{},apiKey:e,baseURL:t})};return q(r,i)},Ke=(e,t=`http://localhost:5933/v1/`)=>{let n=e=>{let{deploymentId:t,region:n,sampleRate:r}=e,i={deploymentId:t,region:n,sampleRate:r};return`disableSsml`in e?i.disableSsml=e.disableSsml:`lang`in e&&(i.lang=e.lang,i.gender=e.gender,i.voice=e.voice),{extraBody:Y(i)}},r={speech:(r,i)=>({...i?n(i):{},apiKey:e,baseURL:t,model:`microsoft/${r}`})},i={voice:r=>(t.endsWith(`v1/`)?t=t.slice(0,-3):t.endsWith(`v1`)&&(t=t.slice(0,-2)),{query:`region=${r?.region}&provider=microsoft`,...r?n(r):{},apiKey:e,baseURL:t})};return q(r,i)},qe=(e,t=`http://localhost:5933/v1/`)=>{let n=t=>{var n,r;let i={app:{appid:(n=t.app)?.appId,token:e}};return t.app!==void 0&&(i.app={...t.app,appid:(r=t.app)?.appId,token:e}),t.user!==void 0&&(i.user=t.user),t.audio!==void 0&&(i.audio=t.audio),{extraBody:Y(i)}},r={speech:(r,i)=>({...i?n(i):{},apiKey:e,baseURL:t,model:`volcengine/${r}`})},i={voice:r=>(t.endsWith(`v1/`)?t=t.slice(0,-3):t.endsWith(`v1`)&&(t=t.slice(0,-2)),{query:`provider=volcengine`,...r?n(r):{},apiKey:e,baseURL:t})};return q(r,i)},Je=(e,t=`http://localhost:5933/v1/`)=>{let n=e=>{let{sampleRate:t,volume:n,rate:r,pitch:i}=e,a={sampleRate:t,volume:n,rate:r,pitch:i};return Object.keys(a).forEach(e=>a[e]===void 0&&delete a[e]),{extraBody:Y(a)}},r={speech:(r,i)=>({...i?n(i):{},apiKey:e,baseURL:t,model:`alibaba/${r}`})},i={voice:r=>{let i=t;return i.endsWith(`v1/`)?i=i.slice(0,-3):i.endsWith(`v1`)&&(i=i.slice(0,-2)),{query:`provider=alibaba`,...r?n(r):{},apiKey:e,baseURL:i}}};return q(r,i)},X=async e=>(e.fetch??globalThis.fetch)(He(e.query?`api/voices?${e.query}`:`api/voices`,e.baseURL),{headers:Ve({...e.headers},e.apiKey),method:`GET`,signal:e.abortSignal}).then(We).then(({voices:e})=>e);const Ye=[{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`}],Z=i(`providers`,()=>{let e=d(`settings/credentials/providers`,{}),{t}=u();async function i(e){try{let t=await fetch(`https://openrouter.ai/api/v1/models`,{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":`application/json`}});if(!t.ok)throw Error(`Failed to fetch OpenRouter models: ${t.statusText}`);let n=await t.json();return n.data.map(e=>({id:e.id,name:e.name||e.id,provider:`openrouter-ai`,description:e.description||``,contextLength:e.context_length,deprecated:!1}))}catch(e){throw console.error(`Error fetching OpenRouter models:`,e),e}}let a={"openrouter-ai":{id:`openrouter-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openrouter.title`,name:`OpenRouter`,descriptionKey:`settings.pages.providers.provider.openrouter.description`,description:`openrouter.ai`,icon:`i-lobe-icons:openrouter`,defaultOptions:()=>({baseUrl:`https://openrouter.ai/api/v1/`}),createProvider:e=>Me(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>i(e)},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"app-local-audio-speech":{id:`app-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-speech.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-speech.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:e=>G(e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...G(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},"app-local-audio-transcription":{id:`app-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-transcription.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-transcription.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:e=>G(e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...G(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},"browser-local-audio-speech":{id:`browser-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>{let e=await re();if(e)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let e=globalThis.navigator.deviceMemory;if(e>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-speech.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-speech.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:e=>G(e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...G(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},"browser-local-audio-transcription":{id:`browser-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>{let e=await re();if(e)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let e=globalThis.navigator.deviceMemory;if(e>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-transcription.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-transcription.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:e=>G(e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...G(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},ollama:{id:`ollama`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:e=>K(e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...K(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},"ollama-embedding":{id:`ollama-embedding`,category:`embed`,tasks:[`text-feature-extraction`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:e=>K(e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...K(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.baseUrl}},vllm:{id:`vllm`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.vllm.title`,name:`vLLM`,descriptionKey:`settings.pages.providers.provider.vllm.description`,description:`vllm.ai`,iconColor:`i-lobe-icons:vllm`,createProvider:e=>K(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`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:e=>G(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...G(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"openai-audio-speech":{id:`openai-audio-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:e=>G(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...G(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"openai-audio-transcription":{id:`openai-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:e=>G(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...G(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},anthropic:{id:`anthropic`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.anthropic.title`,name:`Anthropic`,descriptionKey:`settings.pages.providers.provider.anthropic.description`,description:`anthropic.com`,icon:`i-lobe-icons:anthropic`,defaultOptions:()=>({baseUrl:`https://api.anthropic.com/v1/`}),createProvider:e=>Te(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`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.google-generative-ai.title`,name:`Google Gemini`,descriptionKey:`settings.pages.providers.provider.google-generative-ai.description`,description:`ai.google.dev`,icon:`i-lobe-icons:gemini`,defaultOptions:()=>({baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}),createProvider:e=>Oe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...Oe(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`google-generative-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},xai:{id:`xai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.xai.title`,name:`xAI`,descriptionKey:`settings.pages.providers.provider.xai.description`,description:`x.ai`,icon:`i-lobe-icons:xai`,createProvider:e=>Ie(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...Ie(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`xai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},deepseek:{id:`deepseek`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.deepseek.title`,name:`DeepSeek`,descriptionKey:`settings.pages.providers.provider.deepseek.description`,description:`deepseek.com`,iconColor:`i-lobe-icons:deepseek`,createProvider:e=>Ee(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...Ee(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`deepseek`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},elevenlabs:{id:`elevenlabs`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.elevenlabs.title`,name:`ElevenLabs`,descriptionKey:`settings.pages.providers.provider.elevenlabs.description`,description:`elevenlabs.io`,icon:`i-simple-icons:elevenlabs`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`,voiceSettings:{similarityBoost:.75,stability:.5}}),createProvider:e=>Ge(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>Ye.map(e=>({id:e.model_id,name:e.name,provider:`elevenlabs`,description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{let t=Ge(e.apiKey.trim(),e.baseUrl.trim()),n=await X({...t.voice()}),r=n.findIndex(e=>e.name.includes(`Aria`)),i=n.findIndex(e=>e.name.includes(`Bill`)),a=r===-1?0:r,o=i===-1?n.length-1:i,s=Math.min(a,o),c=Math.max(a,o),l=[...n.slice(0,s),...n.slice(c+1),...n.slice(s,c+1)];return l.map(e=>({id:e.id,name:e.name,provider:`elevenlabs`,previewURL:e.preview_audio_url,languages:e.languages}))}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"microsoft-speech":{id:`microsoft-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.microsoft-speech.title`,name:`Microsoft / Azure Speech`,descriptionKey:`settings.pages.providers.provider.microsoft-speech.description`,description:`speech.microsoft.com`,iconColor:`i-lobe-icons:microsoft`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:e=>Ke(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`v1`,name:`v1`,provider:`microsoft-speech`,description:``,contextLength:0,deprecated:!1}],listVoices:async e=>{let t=Ke(e.apiKey.trim(),e.baseUrl.trim()),n=await X({...t.voice({region:e.region})});return n.map(e=>{var t;return{id:e.id,name:e.name,provider:`microsoft-speech`,previewURL:e.preview_audio_url,languages:e.languages,gender:(t=e.labels)?.gender}})}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"alibaba-cloud-model-studio":{id:`alibaba-cloud-model-studio`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.title`,name:`Alibaba Cloud Model Studio`,descriptionKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.description`,description:`bailian.console.aliyun.com`,iconColor:`i-lobe-icons:alibabacloud`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:e=>Je(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{let t=Je(e.apiKey.trim(),e.baseUrl.trim()),n=await X({...t.voice()});return n.map(e=>{var t;return{id:e.id,name:e.name,provider:`alibaba-cloud-model-studio`,previewURL:e.preview_audio_url,languages:e.languages,gender:(t=e.labels)?.gender}})},listModels:async()=>[{id:`cozyvoice-v1`,name:`CozyVoice`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1},{id:`cozyvoice-v2`,name:`CozyVoice (New)`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},volcengine:{id:`volcengine`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.volcengine.title`,name:`settings.pages.providers.provider.volcengine.title`,descriptionKey:`settings.pages.providers.provider.volcengine.description`,description:`volcengine.com`,iconColor:`i-lobe-icons:volcengine`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:e=>qe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{let t=qe(e.apiKey.trim(),e.baseUrl.trim()),n=await X({...t.voice()});return n.map(e=>{var t;return{id:e.id,name:e.name,provider:`volcano-engine`,previewURL:e.preview_audio_url,languages:e.languages,gender:(t=e.labels)?.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`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.together.title`,name:`Together.ai`,descriptionKey:`settings.pages.providers.provider.together.description`,description:`together.ai`,iconColor:`i-lobe-icons:together`,createProvider:e=>Pe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...Pe(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`together-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"novita-ai":{id:`novita-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.novita.title`,name:`Novita`,descriptionKey:`settings.pages.providers.provider.novita.description`,description:`novita.ai`,iconColor:`i-lobe-icons:novita`,createProvider:e=>je(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...je(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`novita-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"fireworks-ai":{id:`fireworks-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.fireworks.title`,name:`Fireworks.ai`,descriptionKey:`settings.pages.providers.provider.fireworks.description`,description:`fireworks.ai`,icon:`i-lobe-icons:fireworks`,createProvider:e=>De(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...De(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`fireworks-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"featherless-ai":{id:`featherless-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.featherless.title`,name:`Featherless.ai`,descriptionKey:`settings.pages.providers.provider.featherless.description`,description:`featherless.ai`,icon:`i-lobe-icons:featherless-ai`,defaultOptions:()=>({baseUrl:`https://api.featherless.ai/v1/`}),createProvider:e=>G(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...G(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`featherless-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"player2-api":{id:`player2-api`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.player2.title`,name:`Player2 API`,descriptionKey:`settings.pages.providers.provider.player2.description`,description:`player2.game`,defaultOptions:()=>({baseUrl:`http://localhost:4315/v1/`}),createProvider:e=>Re(e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`player2-model`,name:`Player2 Model`,provider:`player2-api`}]},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}health`).then(e=>e.ok).catch(()=>!1):!1}},"cloudflare-workers-ai":{id:`cloudflare-workers-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.cloudflare-workers-ai.title`,name:`Cloudflare Workers AI`,descriptionKey:`settings.pages.providers.provider.cloudflare-workers-ai.description`,description:`cloudflare.com`,iconColor:`i-lobe-icons:cloudflare`,createProvider:e=>Fe(e.apiKey.trim(),e.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.accountId}},"perplexity-ai":{id:`perplexity-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.perplexity.title`,name:`Perplexity`,descriptionKey:`settings.pages.providers.provider.perplexity.description`,description:`perplexity.ai`,icon:`i-lobe-icons:perplexity`,defaultOptions:()=>({baseUrl:`https://api.perplexity.ai`}),createProvider:e=>Ne(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`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.mistral.title`,name:`Mistral`,descriptionKey:`settings.pages.providers.provider.mistral.description`,description:`mistral.ai`,iconColor:`i-lobe-icons:mistral`,createProvider:e=>ke(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...ke(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`mistral-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"moonshot-ai":{id:`moonshot-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.moonshot.title`,name:`Moonshot AI`,descriptionKey:`settings.pages.providers.provider.moonshot.description`,description:`moonshot.ai`,icon:`i-lobe-icons:moonshot`,createProvider:e=>Ae(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await j({...Ae(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`moonshot-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}}};async function o(t){let n=e.value[t];if(!n)return!1;let r=a[t];return r?await r.validators.validateProviderConfig(n):!1}let c=s({});function l(t){if(!e.value[t]){var n;let r=a[t],i=(n=r.defaultOptions)?.call(r)||{};e.value[t]={baseUrl:i.baseUrl||``}}}Object.keys(a).forEach(l);async function p(){await Promise.all(Object.keys(a).map(async e=>{c.value[e]=await o(e)}))}p(),f(e,p,{deep:!0});let m=n(()=>Object.keys(a).filter(e=>c.value[e])),h=s({}),g=s({}),_=s({});async function v(t){let n=e.value[t];if(!n)return[];let r=a[t];if(!r)return[];g.value[t]=!0,_.value[t]=null;try{let e=r.capabilities.listModels?await r.capabilities.listModels(n):[];return h.value[t]=e.map(e=>({id:e.id,name:e.name,description:e.description,contextLength:e.contextLength,deprecated:e.deprecated,provider:t})),h.value[t]}catch(e){return console.error(`Error fetching models for ${t}:`,e),_.value[t]=e instanceof Error?e.message:`Unknown error`,[]}finally{g.value[t]=!1}}function y(e){return h.value[e]||[]}let b=n(()=>{let e=[];for(let t of m.value)e.push(...h.value[t]||[]);return e});async function x(){for(let e of m.value)a[e].capabilities.listModels&&await v(e)}function S(e){let n=a[e];if(!n)throw Error(`Provider metadata for ${e} not found`);return{...n,localizedName:t(n.nameKey,n.name),localizedDescription:t(n.descriptionKey,n.description)}}let C=n(()=>Object.values(a).map(e=>({...e,localizedName:t(e.nameKey,e.name),localizedDescription:t(e.descriptionKey,e.description),configured:c.value[e.id]||!1})));function w(t){let n=e.value[t];if(!n)throw Error(`Provider credentials for ${t} not found`);let r=a[t];if(!r)throw Error(`Provider metadata for ${t} not found`);try{return r.createProvider(n)}catch(e){throw console.error(`Error creating provider instance for ${t}:`,e),e}}let T=r(async()=>{let e=[];for(let t of C.value){let n=S(t.id),r=n.isAvailableBy||(()=>!0),i=await r();i&&e.push(t)}return e},[]),E=n(()=>T.value.filter(e=>e.category===`chat`)),D=n(()=>T.value.filter(e=>e.category===`speech`)),O=n(()=>T.value.filter(e=>e.category===`transcription`)),k=n(()=>E.value.filter(e=>c.value[e.id])),A=n(()=>D.value.filter(e=>c.value[e.id])),ee=n(()=>O.value.filter(e=>c.value[e.id]));function te(t){return e.value[t]}return{providers:e,getProviderConfig:te,availableProviders:m,configuredProviders:c,providerMetadata:a,getProviderMetadata:S,allProvidersMetadata:C,initializeProvider:l,validateProvider:o,availableModels:h,isLoadingModels:g,modelLoadError:_,fetchModelsForProvider:v,getModelsForProvider:y,allAvailableModels:b,loadModelsForConfiguredProviders:x,getProviderInstance:w,availableProvidersMetadata:T,allChatProvidersMetadata:E,allAudioSpeechProvidersMetadata:D,allAudioTranscriptionProvidersMetadata:O,configuredChatProvidersMetadata:k,configuredSpeechProvidersMetadata:A,configuredTranscriptionProvidersMetadata:ee}}),Xe=i(`consciousness`,()=>{let e=Z(),t=d(`settings/consciousness/active-provider`,``),r=d(`settings/consciousness/active-model`,``),i=d(`settings/consciousness/active-custom-model`,``),a=s({}),o=s(``),c=n(()=>{var n;return(n=e.getProviderMetadata(t.value))?.capabilities.listModels!==void 0}),l=n(()=>e.getModelsForProvider(t.value)),u=n(()=>e.isLoadingModels[t.value]||!1),p=n(()=>e.modelLoadError[t.value]||null),m=n(()=>{if(!o.value.trim())return l.value;let e=o.value.toLowerCase().trim();return l.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function h(){r.value=``,i.value=``,a.value={},o.value=``}async function g(n){var r;n&&(r=e.getProviderMetadata(t.value))?.capabilities.listModels!==void 0&&e.getModelsForProvider(n).length===0&&await e.fetchModelsForProvider(n)}let _;return f(t,async e=>{await g(e),h(),e===`player2-api`?_=setInterval(()=>{console.log(`Sending Player2 Health check if it is being used`),fetch(`http://localhost:4315/v1/health`).catch(()=>{})},6e4):(_&&clearInterval(_),_=void 0)}),{activeProvider:t,activeModel:r,customModelName:i,expandedDescriptions:a,modelSearchQuery:o,supportsModelListing:c,providerModels:l,isLoadingActiveProviderModels:u,activeProviderModelError:p,filteredModels:m,resetModelSelection:h,loadModelsForProvider:g}}),Ze=async e=>(e.fetch??globalThis.fetch)(A(`audio/speech`,e.baseURL),{body:O(e),headers:k({"Content-Type":`application/json`,...e.headers},e.apiKey),method:`POST`,signal:e.abortSignal}).then(ee).then(async e=>e.arrayBuffer()),Qe=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function Q(e,t,n){let r=$e(e);return n?r.replace(n,i):i(r);function i(e){return C(e,{subset:t})}}function $e(e){return String(e||``).replace(Qe,``)}const et=/]]>/g,tt=[`>`];function nt(e){return``+Q(e.value,tt,et)+``}function rt(e){return``}const it=[` `,` -`,` `,`"`,`&`,`'`,`/`,`<`,`=`,`>`];function $(e){return Q(e,it)}function at(e,t){let n=String(e),r=t.options.quote||`"`;if(t.options.quoteSmart){let e=r===`"`?`'`:`"`;S(n,r)>S(n,e)&&(r=e)}return r+Q(n,[`<`,`&`,r])+r}function ot(e,t){let n=$(e.name),r=e.public,i=e.system,a=``}const st={}.hasOwnProperty;function ct(e,t){let n=$(e.name),r=vt(e,t),i=e.attributes||{},a=r?!1:t.options.closeEmptyElements,o=[],s;for(s in i)if(st.call(i,s)){let e=i[s];e!=null&&o.push($(s)+`=`+at(e,t))}return`<`+n+(o.length===0?``:` `+o.join(` `))+(a?(t.options.tightClose?``:` `)+`/`:``)+`>`+r+(a?``:``)}const lt=/\?>/g,ut=[`>`];function dt(e){let t=$(e.name)||`x`,n=Q(e.value,ut,lt);return``}const ft=[`&`,`<`];function pt(e){return Q(e.value,ft)}function mt(e,t){return t.options.allowDangerousXml?e.value:pt(e)}const ht={}.hasOwnProperty,gt={cdata:nt,comment:rt,doctype:ot,element:ct,instruction:dt,raw:mt,root:vt,text:pt};function _t(e,t){let n=e&&e.type;if(!n)throw Error("Expected node, not `"+e+"`");if(!ht.call(gt,n))throw Error("Cannot compile unknown node `"+n+"`");let r=gt[n],i=r(e,t);return i}function vt(e,t){let n=e&&e.children||[],r=-1,i=[];for(;++r{let e=Z(),t=d(`settings/speech/active-provider`,``),r=d(`settings/speech/active-model`,`eleven_multilingual_v2`),i=d(`settings/speech/voice`,``),a=s(),c=d(`settings/speech/pitch`,0),l=d(`settings/speech/rate`,1),u=d(`settings/speech/ssml-enabled`,!1),p=s(!1),m=s(null),h=s({}),g=d(`settings/speech/language`,`en-US`),_=s(``),v=n(()=>e.availableProviders.filter(e=>T(e)).map(t=>e.getProviderMetadata(t))),y=n(()=>{var n;return(n=e.getProviderMetadata(t.value))?.capabilities.listModels!==void 0}),b=n(()=>e.getModelsForProvider(t.value)),x=n(()=>e.isLoadingModels[t.value]||!1),S=n(()=>e.modelLoadError[t.value]||null),C=n(()=>{if(!_.value.trim())return b.value;let e=_.value.toLowerCase().trim();return b.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),w=n(()=>[`elevenlabs`,`microsoft-speech`,`azure-speech`,`google`,`alibaba-cloud-model-studio`,`volcengine`].includes(t.value));function T(e){return[`elevenlabs`,`microsoft-speech`,`azure-speech`,`google`,`amazon`,`alibaba-cloud-model-studio`,`volcengine`].includes(e)}async function E(t){if(!t||!T(t))return[];p.value=!0,m.value=null;try{var n,r;let i=await(n=(r=e.getProviderMetadata(t).capabilities).listVoices)?.call(r,e.getProviderConfig(t))||[];return h.value[t]=i,i}catch(e){return console.error(`Error fetching voices for ${t}:`,e),m.value=e instanceof Error?e.message:`Unknown error`,[]}finally{p.value=!1}}function D(e){return h.value[e]||[]}f(t,async e=>{e&&await E(e)}),o(()=>{E(t.value).then(()=>{var e;i.value&&(a.value=(e=h.value[t.value])?.find(e=>e.id===i.value))})}),f(i,e=>{var n;e&&(a.value=(n=h.value[t.value])?.find(t=>t.id===e))},{immediate:!0}),f(h,e=>{var n;i.value&&(a.value=(n=e[t.value])?.find(e=>e.id===i.value))},{immediate:!0});async function O(e,t,n,r,i={}){let a=await Ze({...e.speech(t,{...i}),input:n,voice:r});return a}function k(e,t,n){var r;let i=n?.pitch,a=n?.speed,o=n?.volume,s={pitch:i==null?void 0:i>0?`+${i}%`:`-${i}%`,rate:a==null?void 0:a===1?`1`:`${a}`,volume:o==null?void 0:o>0?`+${o}%`:`${o}%`},c=bt(`speak`,{version:`1.0`,xmlns:`http://www.w3.org/2001/10/synthesis`,"xml:lang":(r=t.languages[0])?.code||`en-US`},[bt(`voice`,{name:t.id,gender:t.gender||`neutral`},[Object.entries(s).filter(([e,t])=>t!=null).length>0?bt(`prosody`,{pitch:i==null?void 0:i>0?`+${i}%`:`-${i}%`,rate:a==null?void 0:a===1?`1`:`${a}`,volume:o==null?void 0:o>0?`+${o}%`:`${o}%`},[e]):e])]);return yt(c)}return{activeSpeechProvider:t,activeSpeechModel:r,activeSpeechVoice:a,activeSpeechVoiceId:i,pitch:c,rate:l,ssmlEnabled:u,selectedLanguage:g,isLoadingSpeechProviderVoices:p,speechProviderError:m,availableVoices:h,modelSearchQuery:_,availableSpeechProvidersMetadata:v,supportsSSML:w,supportsModelListing:y,providerModels:b,isLoadingActiveProviderModels:x,activeProviderModelError:S,filteredModels:C,speech:O,loadVoicesForProvider:E,getVoicesForProvider:D,generateSSML:k,isSpeechProvider:T}}),wt=i(`airi-card`,()=>{let e=d(`airi-cards`,new Map),t=d(`airi-card-active-id`,`default`),r=n(()=>e.value.get(t.value)),i=Xe(),a=Ct(),{activeModel:s}=c(i),{activeSpeechVoiceId:l,activeSpeechModel:p}=c(a),m=t=>{let n=crypto.randomUUID();return e.value.set(n,v(t)),n},h=t=>{e.value.delete(t)},g=t=>e.value.get(t);function _(e){var t,n,r,i,a,o,c,u,d,f,m;let h=`data`in e?(t=e.data)==null||(t=t.extensions)==null?void 0:t.airi:(n=e.extensions)?.airi,g={consciousness:{model:s.value},speech:{model:p.value,voice_id:l.value}};return h?{modules:{consciousness:{model:((r=h.modules)==null||(r=r.consciousness)==null?void 0:r.model)??g.consciousness.model},speech:{model:((i=h.modules)==null||(i=i.speech)==null?void 0:i.model)??g.speech.model,voice_id:((a=h.modules)==null||(a=a.speech)==null?void 0:a.voice_id)??g.speech.voice_id,pitch:(o=h.modules)==null||(o=o.speech)==null?void 0:o.pitch,rate:(c=h.modules)==null||(c=c.speech)==null?void 0:c.rate,ssml:(u=h.modules)==null||(u=u.speech)==null?void 0:u.ssml,language:(d=h.modules)==null||(d=d.speech)==null?void 0:d.language},vrm:(f=h.modules)?.vrm,live2d:(m=h.modules)?.live2d},agents:h.agents??{}}:{modules:g,agents:{}}}function v(e){if(`data`in e){let t=e;return{name:t.data.name,version:t.data.character_version??`1.0.0`,description:t.data.description??``,creator:t.data.creator??``,notes:t.data.creator_notes??``,notesMultilingual:t.data.creator_notes_multilingual,personality:t.data.personality??``,scenario:t.data.scenario??``,greetings:[t.data.first_mes,...t.data.alternate_greetings??[]],greetingsGroupOnly:t.data.group_only_greetings??[],systemPrompt:t.data.system_prompt??``,postHistoryInstructions:t.data.post_history_instructions??``,messageExample:t.data.mes_example?t.data.mes_example.split(` -`).filter(Boolean).map(e=>e.split(` -`).map(e=>{if(e.startsWith(`{{char}}:`)||e.startsWith(`{{user}}:`))return e;throw Error(`Invalid message example format: ${e}`)})):[],tags:t.data.tags??[],extensions:{airi:_(t),...t.data.extensions}}}return{...e,extensions:{airi:_(e),...e.extensions}}}return o(()=>{let{t}=u();e.value.set(`default`,v({name:`ReLU`,version:`1.0.0`,description:E(t(`prompt.prefix`),t(`prompt.suffix`)).content}))}),f(r,e=>{var t,n,r;if(!e)return;let i=_(e);i&&(s.value=i==null||(t=i.modules)==null||(t=t.consciousness)==null?void 0:t.model,p.value=i==null||(n=i.modules)==null||(n=n.speech)==null?void 0:n.model,l.value=i==null||(r=i.modules)==null||(r=r.speech)==null?void 0:r.voice_id)}),{cards:e,activeCard:r,activeCardId:t,addCard:m,removeCard:h,getCard:g,currentModels:n(()=>({consciousness:{model:s.value},speech:{model:p.value,voice_id:l.value}})),systemPrompt:n(()=>{let e=r.value;if(!e)return``;let t=[e.systemPrompt,e.description,e.personality].filter(Boolean);return t.join(` -`)})}}),Tt=i(`chat`,()=>{let{stream:e}=xe(),{systemPrompt:t}=c(wt()),n=s(!1),r=s([]),i=s([]),a=s([]),o=s([]),u=s([]),d=s([]),f=s([]),p=s([]);function m(e){r.value.push(e)}function h(e){i.value.push(e)}function g(e){a.value.push(e)}function _(e){o.value.push(e)}function v(e){u.value.push(e)}function y(e){d.value.push(e)}function b(e){f.value.push(e)}function S(e){p.value.push(e)}let C=s([{role:`system`,content:t.value}]),E=s({role:`assistant`,content:``,slices:[],tool_results:[]});async function D(t,s){try{var c;if(n.value=!0,!t)return;for(let e of r.value)await e(t);let m=w({onLiteral:async e=>{for(let t of u.value)await t(e);E.value.content+=e;let t=E.value.slices.at(-1);if(t?.type===`text`){t.text+=e;return}E.value.slices.push({type:`text`,text:e})},onSpecial:async e=>{for(let t of d.value)await t(e)}}),h=T({handlers:[async e=>{if(e.data.type===`text`){await m.consume(e.data.text);return}if(e.data.type===`tool-call`){E.value.slices.push(e.data);return}e.data.type===`tool-call-result`&&E.value.tool_results.push(e.data)}]});E.value={role:`assistant`,content:``,slices:[],tool_results:[]},C.value.push({role:`user`,content:t}),C.value.push(E.value);let g=C.value.slice(0,C.value.length-1).map(e=>{if(e.role===`assistant`){let{slices:t,...n}=e;return n.tool_results=l(n.tool_results),l(n)}return l(e)});for(let e of i.value)await e(t);for(let e of a.value)await e(t);let _=(c=s.providerConfig)?.headers||{},v=await e(s.model,s.chatProvider,g,{headers:_,onToolCall(e){h.add({type:`tool-call`,toolCall:e})},onToolCallResult(e){h.add({type:`tool-call-result`,id:e.id,result:e.result})}});for(let e of o.value)await e(t);let y=``;for await(let e of x(v.textStream,async e=>e))h.add({type:`text`,text:e}),y+=e;await m.end();for(let e of f.value)await e();for(let e of p.value)await e(y);console.debug(`LLM output:`,y)}catch(e){throw console.error(`Error sending message:`,e),e}finally{n.value=!1}}return{sending:n,messages:C,streamingMessage:E,send:D,onBeforeMessageComposed:m,onAfterMessageComposed:h,onBeforeSend:g,onAfterSend:_,onTokenLiteral:v,onTokenSpecial:y,onStreamEnd:b,onAssistantResponseEnd:S}}),Et=i(`mcp`,()=>{let e=d(`settings/mcp/server-cmd`,``),t=d(`settings/mcp/server-args`,``),n=d(`mcp/connected`,!1);return{serverCmd:e,serverArgs:t,connected:n}}),Dt=globalThis.WebSocket,Ot=async e=>new Promise(t=>setTimeout(t,e));var kt=class{constructor(t){if(e.defineProperty(this,`connected`,!1),e.defineProperty(this,`opts`,void 0),e.defineProperty(this,`websocket`,void 0),e.defineProperty(this,`eventListeners`,new Map),e.defineProperty(this,`reconnectAttempts`,0),e.defineProperty(this,`shouldClose`,!1),this.opts=a(t,{url:`ws://localhost:6121/ws`,possibleEvents:[],onError:()=>{},onClose:()=>{},autoConnect:!0,autoReconnect:!0}),this.opts.autoConnect)try{this.connect()}catch(e){console.error(e)}}async retryWithExponentialBackoff(e,t=0,n=-1){if(n!==-1&&t>=n){console.error(`Maximum retry attempts (${n}) reached`);return}try{await e()}catch(r){console.error(`Encountered an error when retrying`,r),await Ot(2**t*1e3),await this.retryWithExponentialBackoff(e,t++,n)}}async tryReconnectWithExponentialBackoff(){await this.retryWithExponentialBackoff(()=>this._connect(),this.reconnectAttempts)}_connect(){return new Promise((e,t)=>{if(this.shouldClose){e();return}if(this.connected){e();return}this.websocket=new Dt(this.opts.url),this.onEvent(`module:authenticated`,async e=>{let t=e.data.authenticated;t?this.tryAnnounce():this.retryWithExponentialBackoff(()=>this.tryAuthenticate())}),this.websocket.onerror=e=>{var n,r;if((n=(r=this.opts).onError)?.call(r,e),`error`in e&&e.error instanceof Error&&e.error.message===`Received network error or non-101 status code.`){if(this.connected=!1,!this.opts.autoReconnect){var i,a,o,s;(i=(a=this.opts).onError)?.call(a,e),(o=(s=this.opts).onClose)?.call(s),t(e.error);return}t(e.error)}},this.websocket.onclose=()=>{var e,t,n,r;(e=(t=this.opts).onClose)?.call(t),this.connected=!1,this.opts.autoReconnect?this.tryReconnectWithExponentialBackoff():(n=(r=this.opts).onClose)?.call(r)},this.websocket.onmessage=e=>{this.handleMessage(e)},this.websocket.onopen=()=>{this.reconnectAttempts=0,this.opts.token?this.tryAuthenticate():this.tryAnnounce(),this.connected=!0,e()}})}async connect(){await this.tryReconnectWithExponentialBackoff()}tryAnnounce(){this.send({type:`module:announce`,data:{name:this.opts.name,possibleEvents:this.opts.possibleEvents}})}tryAuthenticate(){this.opts.token&&this.send({type:`module:authenticate`,data:{token:this.opts.token||``}})}async handleMessage(e){try{let t=JSON.parse(e.data),n=this.eventListeners.get(t.type);if(!n)return;for(let e of n)await e(t)}catch(e){var t,n;console.error(`Failed to parse message:`,e),(t=(n=this.opts).onError)?.call(n,e)}}onEvent(e,t){this.eventListeners.get(e)||this.eventListeners.set(e,[]);let n=this.eventListeners.get(e);n&&(n.push(t),this.eventListeners.set(e,n))}send(e){var t;(t=this.websocket)?.send(JSON.stringify(e))}sendRaw(e){var t;(t=this.websocket)?.send(e)}close(){this.shouldClose=!0,this.connected&&this.websocket&&(this.websocket.close(),this.connected=!1)}};const At=i(`server`,()=>{let e=s();o(()=>{e.value=new kt({name:`stage-web`,autoConnect:!1,autoReconnect:!0,onError:e=>{console.error(e)}})});function t(){var t;(t=e.value)?.connect()}return{server:e,connect:t}});export{Ze as generateSpeech,wt as useAiriCardStore,se as useAudioContext,Tt as useChatStore,Xe as useConsciousnessStore,Z as useProvidersStore,ce as useSpeakingStore,Ct as useSpeechStore}; \ No newline at end of file diff --git a/assets/stores-zsAuCjXz.js b/assets/stores-zsAuCjXz.js new file mode 100644 index 0000000000000000000000000000000000000000..ec19d63c25d16bcdae63cdcd3f14efbaca850d53 --- /dev/null +++ b/assets/stores-zsAuCjXz.js @@ -0,0 +1,5 @@ +var e=function(exports){function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}return exports.defineProperty=i,exports}({});import{__toESM as t,computed as n,computedAsync as r,defineStore as i,onMounted as a,ref as o,storeToRefs as s,toRaw as c,useI18n as l,useLocalStorage as u,watch as d}from"./index-DKziOBM4.js";import{toJsonSchema as f}from"./index-CISmcbXk-DB1OKNbQ.js";import{arrayType as p,booleanType as m,numberType as h,objectType as g,stringType as _,unionType as v}from"./types-Ba2_UENo.js";import{require___vite_browser_external as y}from"./__vite-browser-external-FU9M8lFq.js";import{ccount as b,stringifyEntitiesLight as x,useLlmmarkerParser as S}from"./composables-D7YQJsZO.js";import{useQueue as C}from"./queue-D6mkPVC_.js";import{system_v2_default as w}from"./queues-BZSFjE0u.js";import{objCamelToSnake as T,requestBody as E,requestHeaders as D,requestURL as O,responseCatch as k,responseJSON as ee,streamText as te}from"./dist-D1uPCnfx.js";import{isWebGPUSupported as ne}from"./webgpu-aYTuek9b.js";function re(e){let t=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(t);let n=[];for(let e=0;e<700;e+=80)n.push(t[e]);let r=t.map(e=>e**1.2).map(e=>e*1.2).reduce((e,t)=>e+t,0);return r/t.length/100}function ie(e){let t=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(t);let n=[];for(let e=0;e<700;e+=80)n.push(t[e]);let r=t.map(e=>e**1.5),i=Math.min(...r),a=Math.max(...r),o=a-i,s;s=o===0?r.map(()=>0):r.map(e=>(e-i)/o);let c=s.reduce((e,t)=>e+t,0);return c/t.length}function ae(e,t=`linear`){switch(t){case`linear`:return re(e);case`minmax`:return ie(e)}}const oe=i(`AudioContext`,()=>{let e=new AudioContext;return{audioContext:e,calculateVolume:ae}}),se=i(`SpeakingStore`,()=>{let e=30,t=100,r=o(0),i=o(!1),a=n(()=>i.value?(e+(t-e)*r.value)/100:e);return{mouthOpenSize:r,nowSpeaking:i,nowSpeakingAvatarBorderOpacity:a}});async function*ce(e,t){let n=e.getReader();try{for(;;){let{done:e,value:r}=await n.read();if(e)return;yield t(r)}}finally{n.releaseLock()}}const A=async e=>(e.fetch??globalThis.fetch)(O(`models`,e.baseURL),{headers:D(e.headers,e.apiKey),signal:e.abortSignal}).then(ee).then(({data:e})=>e),j=async({description:e,execute:t,name:n,parameters:r})=>{let i=await f(r);return{execute:t,function:{description:e,name:n,parameters:{...i,additionalProperties:!1},strict:!0},type:`function`}},le=[j({name:`debug_random_number`,description:`Generate a random number between 0 and 1`,execute:async()=>new Promise(e=>{setTimeout(()=>{e(Math.random().toString())},1e3)}),parameters:g({})})],ue=async()=>Promise.all(le);function M(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function N(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var P,F,I,L,de;const fe=`__TAURI_TO_IPC_KEY__`;function pe(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}var me=class{constructor(e){P.set(this,void 0),F.set(this,0),I.set(this,[]),L.set(this,void 0),N(this,P,e||(()=>{}),`f`),this.id=pe(e=>{let t=e.index;if(`end`in e){t==M(this,F,`f`)?this.cleanupCallback():N(this,L,t,`f`);return}let n=e.message;if(t==M(this,F,`f`)){for(M(this,P,`f`).call(this,n),N(this,F,M(this,F,`f`)+1,`f`);M(this,F,`f`)in M(this,I,`f`);){let e=M(this,I,`f`)[M(this,F,`f`)];M(this,P,`f`).call(this,e),delete M(this,I,`f`)[M(this,F,`f`)],N(this,F,M(this,F,`f`)+1,`f`)}M(this,F,`f`)===M(this,L,`f`)&&this.cleanupCallback()}else M(this,I,`f`)[t]=n})}cleanupCallback(){Reflect.deleteProperty(window,`_${this.id}`)}set onmessage(e){N(this,P,e,`f`)}get onmessage(){return M(this,P,`f`)}[(P=new WeakMap,F=new WeakMap,I=new WeakMap,L=new WeakMap,fe)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[fe]()}};async function R(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}de=new WeakMap;async function he(e,t){await R(`plugin:mcp|connect_server`,{command:e,args:t})}async function ge(){await R(`plugin:mcp|disconnect_server`)}async function _e(){return await R(`plugin:mcp|list_tools`)}async function ve(e,t){return await R(`plugin:mcp|call_tool`,{name:e,args:t})}const ye=[j({name:`mcp_list_tools`,description:`List all tools available on the MCP server`,execute:async(e,t)=>await _e(),parameters:g({})}),j({name:`mcp_connect_server`,description:`Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.`,execute:async({command:e,args:t})=>(await he(e,t),`success`),parameters:g({command:_().describe(`The command to connect to the MCP server`),args:p(_()).describe(`The arguments to pass to the MCP server`)})}),j({name:`mcp_disconnect_server`,description:`Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.`,execute:async()=>(await ge(),`success`),parameters:g({})}),j({name:`mcp_call_tool`,description:`Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.`,execute:async({name:e,parameters:t})=>{let n=Object.fromEntries(t.map(({name:e,value:t})=>[e,t])),r=await ve(e,n);return r},parameters:g({name:_().describe(`The name of the tool to call`),parameters:p(g({name:_().describe(`The name of the parameter`),value:v([_(),h(),m(),g({})]).describe(`The value of the parameter, it can be a string, a number, a boolean, or an object`)})).describe(`The parameters to pass to the tool`)})})],be=async()=>Promise.all(ye),xe=i(`llm`,()=>{async function e(e,t,n,r){let i=r?.headers;return await te({...t.chat(e),maxSteps:10,messages:n.map(e=>({...e,content:e.role===`error`?`User encountered error: ${e.content}`:e.content,role:e.role===`error`?`user`:e.role})),headers:i,tools:[...await be(),...await ue()],onEvent(e){var t,n;e.type===`tool-call`?r==null||(t=r.onToolCall)==null||t.call(r,e.toolCall):e.type===`tool-call-result`&&(r==null||(n=r.onToolCallResult)==null||n.call(r,{id:e.id,result:e.result}))}})}async function t(e,t){if(e===``)return[];try{return await A({baseURL:e.endsWith(`/`)?e:`${e}/`,apiKey:t})}catch(e){if(String(e).includes(`Failed to construct 'URL': Invalid URL`))return[];throw e}}return{models:t,stream:e}}),z=e=>({chat:t=>Object.assign(e,{model:t})}),B=e=>({embed:t=>Object.assign(e,{model:t})}),Se=e=>({image:t=>Object.assign(e,{model:t})}),V=e=>({model:()=>e}),Ce=e=>({speech:t=>Object.assign(e,{model:t})}),we=e=>({transcription:t=>Object.assign(e,{model:t})}),H=(e,t)=>({metadata:{id:e,...t}}),U=(...e)=>Object.assign(e[0],...e.slice(1)),Te=(e,t=`https://api.anthropic.com/v1/`)=>U(H(`anthropic`),z({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),Ee=(e,t=`https://api.deepseek.com/`)=>U(H(`deepseek`),z({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),De=(e,t=`https://api.fireworks.ai/inference/v1/`)=>U(H(`fireworks`),z({apiKey:e,baseURL:t}),B({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),Oe=(e,t=`https://generativelanguage.googleapis.com/v1beta/openai/`)=>U(H(`google-generative-ai`),z({apiKey:e,baseURL:t}),B({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),ke=(e,t=`https://api.mistral.ai/v1/`)=>U(H(`mistral`),z({apiKey:e,baseURL:t}),B({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),Ae=(e,t=`https://api.moonshot.cn/v1/`)=>U(H(`moonshot`),z({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),je=(e,t=`https://api.novita.ai/v3/openai/`)=>U(H(`novita`),z({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),W=(e,t=`https://api.openai.com/v1/`)=>U(H(`openai`),z({apiKey:e,baseURL:t}),B({apiKey:e,baseURL:t}),Se({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t}),Ce({apiKey:e,baseURL:t}),we({apiKey:e,baseURL:t})),Me=(e,t=``)=>U(H(`openrouter`),{chat:(n,r)=>{let i={apiKey:e,baseURL:t,model:n},a=({extraHeaders:e,models:t,provider:n})=>{e!=null&&(i.headers??={},Object.assign(i.headers,e));let r;return n!=null&&(r=T(n)),T({models:t,provider:r})};return{...r?a(r):{},...i}}},V({apiKey:e,baseURL:t})),Ne=(e,t=`https://api.perplexity.ai/`)=>U(H(`perplexity`),z({apiKey:e,baseURL:t})),Pe=(e,t=`https://api.together.xyz/v1/`)=>U(H(`together-ai`),z({apiKey:e,baseURL:t}),B({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t,fetch:async(...e)=>globalThis.fetch(...e).then(async e=>e.json()).then(e=>Response.json({data:e,object:`list`}))})),Fe=(e,t)=>{let n=`https://api.cloudflare.com/client/v4/accounts/${t}/ai/v1/`;return U(H(`workers-ai`),z({apiKey:e,baseURL:n}),B({apiKey:e,baseURL:n}))},Ie=(e,t=`https://api.x.ai/v1/`)=>U(H(`xai`),z({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t}));var Le=t(y());const G=(e=`http://localhost:11434/v1/`)=>U(H(`ollama`),z({baseURL:e}),B({baseURL:e}),V({baseURL:e})),Re=(e=`http://localhost:4315/v1/`,t=`xsai`)=>U(H(`player2`),z({baseURL:e,headers:{"player2-game-key":t}}),Ce({baseURL:e,fetch:async(e,t)=>{let n=`${e.toString().slice(0,-12)}tts/speak`;try{let{input:e,response_format:n,speed:r,voice:i,...a}=JSON.parse(t?.body),o={audio_format:n,play_in_app:!1,speed:r??1,text:e,voice_ids:i==null?[]:[i],...a};t&&(t.body=JSON.stringify(o))}catch(e){console.warn(`Could not parse body as JSON:`,e)}return globalThis.fetch(n,t).then(async e=>e.json()).then(e=>{let t=e.data??``,n=Le.Buffer.from(t,`base64`).toString(`binary`),r=Uint8Array.from(Array.from(n,e=>e.charCodeAt(0)));for(let e=0;eObject.assign(e[0],...e.slice(1));var q=class extends Error{constructor(t,n){super(t),e.defineProperty(this,`response`,void 0),this.name=`XSAIError`,this.response=n}};const ze=e=>e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`),J=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[ze(e),t])),Be=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),Ve=(e,t)=>Be({Authorization:t===void 0?void 0:`Bearer ${t}`,...e}),He=(e,t)=>{let n=t.toString();return new URL(e,n.endsWith(`/`)?n:`${n}/`)},Ue=async e=>{if(!e.ok)throw new q(`Remote sent ${e.status} response: ${await e.text()}`,e);if(!e.body)throw new q(`Response body is empty from remote server`,e);if(!(e.body instanceof ReadableStream))throw new q(`Expected Response body to be a ReadableStream, but got ${String(e.body)}; Content Type is ${e.headers.get(`Content-Type`)}`,e);return e},We=async e=>Ue(e).then(async e=>{let t=await e.text();try{return JSON.parse(t)}catch{throw Error(`Failed to parse response, response body: ${t}`)}});var Ge=(e,t=`http://localhost:5933/v1/`)=>{let n=({applyTextNormalization:e,languageCode:t,nextRequestIds:n,nextText:r,previousRequestIds:i,previousText:a,pronunciationDictionaryLocators:o,seed:s,voiceSettings:c})=>({extraBody:J({applyTextNormalization:e,languageCode:t,nextRequestIds:n,nextText:r,previousRequestIds:i,previousText:a,pronunciationDictionaryLocators:o?o.map(e=>J(e)):void 0,seed:s,voiceSettings:J(c??{similarityBoost:.75,stability:.5})})}),r={speech:(r,i)=>({...i?n(i):{},apiKey:e,baseURL:t,model:`elevenlabs/${r}`})},i={voice:r=>(t.endsWith(`v1/`)?t=t.slice(0,-3):t.endsWith(`v1`)&&(t=t.slice(0,-2)),{query:`provider=elevenlabs`,...r?n(r):{},apiKey:e,baseURL:t})};return K(r,i)},Ke=(e,t=`http://localhost:5933/v1/`)=>{let n=e=>{let{deploymentId:t,region:n,sampleRate:r}=e,i={deploymentId:t,region:n,sampleRate:r};return`disableSsml`in e?i.disableSsml=e.disableSsml:`lang`in e&&(i.lang=e.lang,i.gender=e.gender,i.voice=e.voice),{extraBody:J(i)}},r={speech:(r,i)=>({...i?n(i):{},apiKey:e,baseURL:t,model:`microsoft/${r}`})},i={voice:r=>(t.endsWith(`v1/`)?t=t.slice(0,-3):t.endsWith(`v1`)&&(t=t.slice(0,-2)),{query:`region=${r?.region}&provider=microsoft`,...r?n(r):{},apiKey:e,baseURL:t})};return K(r,i)},qe=(e,t=`http://localhost:5933/v1/`)=>{let n=t=>{var n,r;let i={app:{appid:(n=t.app)?.appId,token:e}};return t.app!==void 0&&(i.app={...t.app,appid:(r=t.app)?.appId,token:e}),t.user!==void 0&&(i.user=t.user),t.audio!==void 0&&(i.audio=t.audio),{extraBody:J(i)}},r={speech:(r,i)=>({...i?n(i):{},apiKey:e,baseURL:t,model:`volcengine/${r}`})},i={voice:r=>(t.endsWith(`v1/`)?t=t.slice(0,-3):t.endsWith(`v1`)&&(t=t.slice(0,-2)),{query:`provider=volcengine`,...r?n(r):{},apiKey:e,baseURL:t})};return K(r,i)},Je=(e,t=`http://localhost:5933/v1/`)=>{let n=e=>{let{sampleRate:t,volume:n,rate:r,pitch:i}=e,a={sampleRate:t,volume:n,rate:r,pitch:i};return Object.keys(a).forEach(e=>a[e]===void 0&&delete a[e]),{extraBody:J(a)}},r={speech:(r,i)=>({...i?n(i):{},apiKey:e,baseURL:t,model:`alibaba/${r}`})},i={voice:r=>{let i=t;return i.endsWith(`v1/`)?i=i.slice(0,-3):i.endsWith(`v1`)&&(i=i.slice(0,-2)),{query:`provider=alibaba`,...r?n(r):{},apiKey:e,baseURL:i}}};return K(r,i)},Y=async e=>(e.fetch??globalThis.fetch)(He(e.query?`api/voices?${e.query}`:`api/voices`,e.baseURL),{headers:Ve({...e.headers},e.apiKey),method:`GET`,signal:e.abortSignal}).then(We).then(({voices:e})=>e);const Ye=[{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`}],X=i(`providers`,()=>{let e=u(`settings/credentials/providers`,{}),{t}=l();async function i(e){try{let t=await fetch(`https://openrouter.ai/api/v1/models`,{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":`application/json`}});if(!t.ok)throw Error(`Failed to fetch OpenRouter models: ${t.statusText}`);let n=await t.json();return n.data.map(e=>({id:e.id,name:e.name||e.id,provider:`openrouter-ai`,description:e.description||``,contextLength:e.context_length,deprecated:!1}))}catch(e){throw console.error(`Error fetching OpenRouter models:`,e),e}}let a={"openrouter-ai":{id:`openrouter-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openrouter.title`,name:`OpenRouter`,descriptionKey:`settings.pages.providers.provider.openrouter.description`,description:`openrouter.ai`,icon:`i-lobe-icons:openrouter`,defaultOptions:()=>({baseUrl:`https://openrouter.ai/api/v1/`}),createProvider:e=>Me(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>i(e)},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"app-local-audio-speech":{id:`app-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-speech.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-speech.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:e=>W(e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...W(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},"app-local-audio-transcription":{id:`app-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-transcription.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-transcription.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:e=>W(e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...W(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},"browser-local-audio-speech":{id:`browser-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>{let e=await ne();if(e)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let e=globalThis.navigator.deviceMemory;if(e>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-speech.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-speech.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:e=>W(e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...W(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},"browser-local-audio-transcription":{id:`browser-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>{let e=await ne();if(e)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let e=globalThis.navigator.deviceMemory;if(e>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-transcription.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-transcription.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:e=>W(e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...W(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},ollama:{id:`ollama`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:e=>G(e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...G(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(e=>e.ok).catch(()=>!1):!1}},"ollama-embedding":{id:`ollama-embedding`,category:`embed`,tasks:[`text-feature-extraction`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:e=>G(e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...G(e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.baseUrl}},vllm:{id:`vllm`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.vllm.title`,name:`vLLM`,descriptionKey:`settings.pages.providers.provider.vllm.description`,description:`vllm.ai`,iconColor:`i-lobe-icons:vllm`,createProvider:e=>G(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`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"openai-audio-speech":{id:`openai-audio-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"openai-audio-transcription":{id:`openai-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},anthropic:{id:`anthropic`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.anthropic.title`,name:`Anthropic`,descriptionKey:`settings.pages.providers.provider.anthropic.description`,description:`anthropic.com`,icon:`i-lobe-icons:anthropic`,defaultOptions:()=>({baseUrl:`https://api.anthropic.com/v1/`}),createProvider:e=>Te(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`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.google-generative-ai.title`,name:`Google Gemini`,descriptionKey:`settings.pages.providers.provider.google-generative-ai.description`,description:`ai.google.dev`,icon:`i-lobe-icons:gemini`,defaultOptions:()=>({baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}),createProvider:e=>Oe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...Oe(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`google-generative-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},xai:{id:`xai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.xai.title`,name:`xAI`,descriptionKey:`settings.pages.providers.provider.xai.description`,description:`x.ai`,icon:`i-lobe-icons:xai`,createProvider:e=>Ie(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...Ie(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`xai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},deepseek:{id:`deepseek`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.deepseek.title`,name:`DeepSeek`,descriptionKey:`settings.pages.providers.provider.deepseek.description`,description:`deepseek.com`,iconColor:`i-lobe-icons:deepseek`,createProvider:e=>Ee(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...Ee(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`deepseek`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},elevenlabs:{id:`elevenlabs`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.elevenlabs.title`,name:`ElevenLabs`,descriptionKey:`settings.pages.providers.provider.elevenlabs.description`,description:`elevenlabs.io`,icon:`i-simple-icons:elevenlabs`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`,voiceSettings:{similarityBoost:.75,stability:.5}}),createProvider:e=>Ge(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>Ye.map(e=>({id:e.model_id,name:e.name,provider:`elevenlabs`,description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{let t=Ge(e.apiKey.trim(),e.baseUrl.trim()),n=await Y({...t.voice()}),r=n.findIndex(e=>e.name.includes(`Aria`)),i=n.findIndex(e=>e.name.includes(`Bill`)),a=r===-1?0:r,o=i===-1?n.length-1:i,s=Math.min(a,o),c=Math.max(a,o),l=[...n.slice(0,s),...n.slice(c+1),...n.slice(s,c+1)];return l.map(e=>({id:e.id,name:e.name,provider:`elevenlabs`,previewURL:e.preview_audio_url,languages:e.languages}))}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"microsoft-speech":{id:`microsoft-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.microsoft-speech.title`,name:`Microsoft / Azure Speech`,descriptionKey:`settings.pages.providers.provider.microsoft-speech.description`,description:`speech.microsoft.com`,iconColor:`i-lobe-icons:microsoft`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:e=>Ke(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`v1`,name:`v1`,provider:`microsoft-speech`,description:``,contextLength:0,deprecated:!1}],listVoices:async e=>{let t=Ke(e.apiKey.trim(),e.baseUrl.trim()),n=await Y({...t.voice({region:e.region})});return n.map(e=>{var t;return{id:e.id,name:e.name,provider:`microsoft-speech`,previewURL:e.preview_audio_url,languages:e.languages,gender:(t=e.labels)?.gender}})}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"alibaba-cloud-model-studio":{id:`alibaba-cloud-model-studio`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.title`,name:`Alibaba Cloud Model Studio`,descriptionKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.description`,description:`bailian.console.aliyun.com`,iconColor:`i-lobe-icons:alibabacloud`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:e=>Je(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{let t=Je(e.apiKey.trim(),e.baseUrl.trim()),n=await Y({...t.voice()});return n.map(e=>{var t;return{id:e.id,name:e.name,provider:`alibaba-cloud-model-studio`,previewURL:e.preview_audio_url,languages:e.languages,gender:(t=e.labels)?.gender}})},listModels:async()=>[{id:`cozyvoice-v1`,name:`CozyVoice`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1},{id:`cozyvoice-v2`,name:`CozyVoice (New)`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},volcengine:{id:`volcengine`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.volcengine.title`,name:`settings.pages.providers.provider.volcengine.title`,descriptionKey:`settings.pages.providers.provider.volcengine.description`,description:`volcengine.com`,iconColor:`i-lobe-icons:volcengine`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:e=>qe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{let t=qe(e.apiKey.trim(),e.baseUrl.trim()),n=await Y({...t.voice()});return n.map(e=>{var t;return{id:e.id,name:e.name,provider:`volcano-engine`,previewURL:e.preview_audio_url,languages:e.languages,gender:(t=e.labels)?.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`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.together.title`,name:`Together.ai`,descriptionKey:`settings.pages.providers.provider.together.description`,description:`together.ai`,iconColor:`i-lobe-icons:together`,createProvider:e=>Pe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...Pe(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`together-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"novita-ai":{id:`novita-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.novita.title`,name:`Novita`,descriptionKey:`settings.pages.providers.provider.novita.description`,description:`novita.ai`,iconColor:`i-lobe-icons:novita`,createProvider:e=>je(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...je(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`novita-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"fireworks-ai":{id:`fireworks-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.fireworks.title`,name:`Fireworks.ai`,descriptionKey:`settings.pages.providers.provider.fireworks.description`,description:`fireworks.ai`,icon:`i-lobe-icons:fireworks`,createProvider:e=>De(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...De(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`fireworks-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"featherless-ai":{id:`featherless-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.featherless.title`,name:`Featherless.ai`,descriptionKey:`settings.pages.providers.provider.featherless.description`,description:`featherless.ai`,icon:`i-lobe-icons:featherless-ai`,defaultOptions:()=>({baseUrl:`https://api.featherless.ai/v1/`}),createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`featherless-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"player2-api":{id:`player2-api`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.player2.title`,name:`Player2 API`,descriptionKey:`settings.pages.providers.provider.player2.description`,description:`player2.game`,defaultOptions:()=>({baseUrl:`http://localhost:4315/v1/`}),createProvider:e=>Re(e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`player2-model`,name:`Player2 Model`,provider:`player2-api`}]},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}health`).then(e=>e.ok).catch(()=>!1):!1}},"cloudflare-workers-ai":{id:`cloudflare-workers-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.cloudflare-workers-ai.title`,name:`Cloudflare Workers AI`,descriptionKey:`settings.pages.providers.provider.cloudflare-workers-ai.description`,description:`cloudflare.com`,iconColor:`i-lobe-icons:cloudflare`,createProvider:e=>Fe(e.apiKey.trim(),e.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.accountId}},"perplexity-ai":{id:`perplexity-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.perplexity.title`,name:`Perplexity`,descriptionKey:`settings.pages.providers.provider.perplexity.description`,description:`perplexity.ai`,icon:`i-lobe-icons:perplexity`,defaultOptions:()=>({baseUrl:`https://api.perplexity.ai`}),createProvider:e=>Ne(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`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.mistral.title`,name:`Mistral`,descriptionKey:`settings.pages.providers.provider.mistral.description`,description:`mistral.ai`,iconColor:`i-lobe-icons:mistral`,createProvider:e=>ke(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...ke(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`mistral-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"moonshot-ai":{id:`moonshot-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.moonshot.title`,name:`Moonshot AI`,descriptionKey:`settings.pages.providers.provider.moonshot.description`,description:`moonshot.ai`,icon:`i-lobe-icons:moonshot`,createProvider:e=>Ae(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...Ae(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(e=>({id:e.id,name:e.id,provider:`moonshot-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}}};async function s(t){let n=e.value[t];if(!n)return!1;let r=a[t];return r?await r.validators.validateProviderConfig(n):!1}let c=o({});function f(t){if(!e.value[t]){var n;let r=a[t],i=(n=r.defaultOptions)?.call(r)||{};e.value[t]={baseUrl:i.baseUrl||``}}}Object.keys(a).forEach(f);async function p(){await Promise.all(Object.keys(a).map(async e=>{c.value[e]=await s(e)}))}p(),d(e,p,{deep:!0});let m=n(()=>Object.keys(a).filter(e=>c.value[e])),h=o({}),g=o({}),_=o({});async function v(t){let n=e.value[t];if(!n)return[];let r=a[t];if(!r)return[];g.value[t]=!0,_.value[t]=null;try{let e=r.capabilities.listModels?await r.capabilities.listModels(n):[];return h.value[t]=e.map(e=>({id:e.id,name:e.name,description:e.description,contextLength:e.contextLength,deprecated:e.deprecated,provider:t})),h.value[t]}catch(e){return console.error(`Error fetching models for ${t}:`,e),_.value[t]=e instanceof Error?e.message:`Unknown error`,[]}finally{g.value[t]=!1}}function y(e){return h.value[e]||[]}let b=n(()=>{let e=[];for(let t of m.value)e.push(...h.value[t]||[]);return e});async function x(){for(let e of m.value)a[e].capabilities.listModels&&await v(e)}function S(e){let n=a[e];if(!n)throw Error(`Provider metadata for ${e} not found`);return{...n,localizedName:t(n.nameKey,n.name),localizedDescription:t(n.descriptionKey,n.description)}}let C=n(()=>Object.values(a).map(e=>({...e,localizedName:t(e.nameKey,e.name),localizedDescription:t(e.descriptionKey,e.description),configured:c.value[e.id]||!1})));function w(t){let n=e.value[t];if(!n)throw Error(`Provider credentials for ${t} not found`);let r=a[t];if(!r)throw Error(`Provider metadata for ${t} not found`);try{return r.createProvider(n)}catch(e){throw console.error(`Error creating provider instance for ${t}:`,e),e}}let T=r(async()=>{let e=[];for(let t of C.value){let n=S(t.id),r=n.isAvailableBy||(()=>!0),i=await r();i&&e.push(t)}return e},[]),E=n(()=>T.value.filter(e=>e.category===`chat`)),D=n(()=>T.value.filter(e=>e.category===`speech`)),O=n(()=>T.value.filter(e=>e.category===`transcription`)),k=n(()=>E.value.filter(e=>c.value[e.id])),ee=n(()=>D.value.filter(e=>c.value[e.id])),te=n(()=>O.value.filter(e=>c.value[e.id]));function re(t){return e.value[t]}return{providers:e,getProviderConfig:re,availableProviders:m,configuredProviders:c,providerMetadata:a,getProviderMetadata:S,allProvidersMetadata:C,initializeProvider:f,validateProvider:s,availableModels:h,isLoadingModels:g,modelLoadError:_,fetchModelsForProvider:v,getModelsForProvider:y,allAvailableModels:b,loadModelsForConfiguredProviders:x,getProviderInstance:w,availableProvidersMetadata:T,allChatProvidersMetadata:E,allAudioSpeechProvidersMetadata:D,allAudioTranscriptionProvidersMetadata:O,configuredChatProvidersMetadata:k,configuredSpeechProvidersMetadata:ee,configuredTranscriptionProvidersMetadata:te}}),Xe=i(`consciousness`,()=>{let e=X(),t=u(`settings/consciousness/active-provider`,``),r=u(`settings/consciousness/active-model`,``),i=u(`settings/consciousness/active-custom-model`,``),a=o({}),s=o(``),c=n(()=>{var n;return(n=e.getProviderMetadata(t.value))?.capabilities.listModels!==void 0}),l=n(()=>e.getModelsForProvider(t.value)),f=n(()=>e.isLoadingModels[t.value]||!1),p=n(()=>e.modelLoadError[t.value]||null),m=n(()=>{if(!s.value.trim())return l.value;let e=s.value.toLowerCase().trim();return l.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function h(){r.value=``,i.value=``,a.value={},s.value=``}async function g(n){var r;n&&(r=e.getProviderMetadata(t.value))?.capabilities.listModels!==void 0&&e.getModelsForProvider(n).length===0&&await e.fetchModelsForProvider(n)}let _;return d(t,async e=>{await g(e),h(),e===`player2-api`?_=setInterval(()=>{console.log(`Sending Player2 Health check if it is being used`),fetch(`http://localhost:4315/v1/health`).catch(()=>{})},6e4):(_&&clearInterval(_),_=void 0)}),{activeProvider:t,activeModel:r,customModelName:i,expandedDescriptions:a,modelSearchQuery:s,supportsModelListing:c,providerModels:l,isLoadingActiveProviderModels:f,activeProviderModelError:p,filteredModels:m,resetModelSelection:h,loadModelsForProvider:g}}),Ze=async e=>(e.fetch??globalThis.fetch)(O(`audio/speech`,e.baseURL),{body:E(e),headers:D({"Content-Type":`application/json`,...e.headers},e.apiKey),method:`POST`,signal:e.abortSignal}).then(k).then(async e=>e.arrayBuffer()),Qe=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function Z(e,t,n){let r=$e(e);return n?r.replace(n,i):i(r);function i(e){return x(e,{subset:t})}}function $e(e){return String(e||``).replace(Qe,``)}const et=/]]>/g,tt=[`>`];function nt(e){return``+Z(e.value,tt,et)+``}function rt(e){return``}const it=[` `,` +`,` `,`"`,`&`,`'`,`/`,`<`,`=`,`>`];function Q(e){return Z(e,it)}function $(e,t){let n=String(e),r=t.options.quote||`"`;if(t.options.quoteSmart){let e=r===`"`?`'`:`"`;b(n,r)>b(n,e)&&(r=e)}return r+Z(n,[`<`,`&`,r])+r}function at(e,t){let n=Q(e.name),r=e.public,i=e.system,a=``}const ot={}.hasOwnProperty;function st(e,t){let n=Q(e.name),r=_t(e,t),i=e.attributes||{},a=r?!1:t.options.closeEmptyElements,o=[],s;for(s in i)if(ot.call(i,s)){let e=i[s];e!=null&&o.push(Q(s)+`=`+$(e,t))}return`<`+n+(o.length===0?``:` `+o.join(` `))+(a?(t.options.tightClose?``:` `)+`/`:``)+`>`+r+(a?``:``)}const ct=/\?>/g,lt=[`>`];function ut(e){let t=Q(e.name)||`x`,n=Z(e.value,lt,ct);return``}const dt=[`&`,`<`];function ft(e){return Z(e.value,dt)}function pt(e,t){return t.options.allowDangerousXml?e.value:ft(e)}const mt={}.hasOwnProperty,ht={cdata:nt,comment:rt,doctype:at,element:st,instruction:ut,raw:pt,root:_t,text:ft};function gt(e,t){let n=e&&e.type;if(!n)throw Error("Expected node, not `"+e+"`");if(!mt.call(ht,n))throw Error("Cannot compile unknown node `"+n+"`");let r=ht[n],i=r(e,t);return i}function _t(e,t){let n=e&&e.children||[],r=-1,i=[];for(;++r{let e=X(),t=u(`settings/speech/active-provider`,``),r=u(`settings/speech/active-model`,`eleven_multilingual_v2`),i=u(`settings/speech/voice`,``),s=o(),c=u(`settings/speech/pitch`,0),l=u(`settings/speech/rate`,1),f=u(`settings/speech/ssml-enabled`,!1),p=o(!1),m=o(null),h=o({}),g=u(`settings/speech/language`,`en-US`),_=o(``),v=n(()=>e.availableProviders.filter(e=>T(e)).map(t=>e.getProviderMetadata(t))),y=n(()=>{var n;return(n=e.getProviderMetadata(t.value))?.capabilities.listModels!==void 0}),b=n(()=>e.getModelsForProvider(t.value)),x=n(()=>e.isLoadingModels[t.value]||!1),S=n(()=>e.modelLoadError[t.value]||null),C=n(()=>{if(!_.value.trim())return b.value;let e=_.value.toLowerCase().trim();return b.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),w=n(()=>[`elevenlabs`,`microsoft-speech`,`azure-speech`,`google`,`alibaba-cloud-model-studio`,`volcengine`].includes(t.value));function T(e){return[`elevenlabs`,`microsoft-speech`,`azure-speech`,`google`,`amazon`,`alibaba-cloud-model-studio`,`volcengine`].includes(e)}async function E(t){if(!t||!T(t))return[];p.value=!0,m.value=null;try{var n,r;let i=await(n=(r=e.getProviderMetadata(t).capabilities).listVoices)?.call(r,e.getProviderConfig(t))||[];return h.value[t]=i,i}catch(e){return console.error(`Error fetching voices for ${t}:`,e),m.value=e instanceof Error?e.message:`Unknown error`,[]}finally{p.value=!1}}function D(e){return h.value[e]||[]}d(t,async e=>{e&&await E(e)}),a(()=>{E(t.value).then(()=>{var e;i.value&&(s.value=(e=h.value[t.value])?.find(e=>e.id===i.value))})}),d(i,e=>{var n;e&&(s.value=(n=h.value[t.value])?.find(t=>t.id===e))},{immediate:!0}),d(h,e=>{var n;i.value&&(s.value=(n=e[t.value])?.find(e=>e.id===i.value))},{immediate:!0});async function O(e,t,n,r,i={}){let a=await Ze({...e.speech(t,{...i}),input:n,voice:r});return a}function k(e,t,n){var r;let i=n?.pitch,a=n?.speed,o=n?.volume,s={pitch:i==null?void 0:i>0?`+${i}%`:`-${i}%`,rate:a==null?void 0:a===1?`1`:`${a}`,volume:o==null?void 0:o>0?`+${o}%`:`${o}%`},c=yt(`speak`,{version:`1.0`,xmlns:`http://www.w3.org/2001/10/synthesis`,"xml:lang":(r=t.languages[0])?.code||`en-US`},[yt(`voice`,{name:t.id,gender:t.gender||`neutral`},[Object.entries(s).filter(([e,t])=>t!=null).length>0?yt(`prosody`,{pitch:i==null?void 0:i>0?`+${i}%`:`-${i}%`,rate:a==null?void 0:a===1?`1`:`${a}`,volume:o==null?void 0:o>0?`+${o}%`:`${o}%`},[e]):e])]);return vt(c)}return{activeSpeechProvider:t,activeSpeechModel:r,activeSpeechVoice:s,activeSpeechVoiceId:i,pitch:c,rate:l,ssmlEnabled:f,selectedLanguage:g,isLoadingSpeechProviderVoices:p,speechProviderError:m,availableVoices:h,modelSearchQuery:_,availableSpeechProvidersMetadata:v,supportsSSML:w,supportsModelListing:y,providerModels:b,isLoadingActiveProviderModels:x,activeProviderModelError:S,filteredModels:C,speech:O,loadVoicesForProvider:E,getVoicesForProvider:D,generateSSML:k,isSpeechProvider:T}}),Ct=i(`airi-card`,()=>{let e=u(`airi-cards`,new Map),t=u(`airi-card-active-id`,`default`),r=n(()=>e.value.get(t.value)),i=Xe(),o=St(),{activeModel:c}=s(i),{activeSpeechVoiceId:f,activeSpeechModel:p}=s(o),m=t=>{let n=crypto.randomUUID();return e.value.set(n,v(t)),n},h=t=>{e.value.delete(t)},g=t=>e.value.get(t);function _(e){var t,n,r,i,a,o,s,l,u,d,m;let h=`data`in e?(t=e.data)==null||(t=t.extensions)==null?void 0:t.airi:(n=e.extensions)?.airi,g={consciousness:{model:c.value},speech:{model:p.value,voice_id:f.value}};return h?{modules:{consciousness:{model:((r=h.modules)==null||(r=r.consciousness)==null?void 0:r.model)??g.consciousness.model},speech:{model:((i=h.modules)==null||(i=i.speech)==null?void 0:i.model)??g.speech.model,voice_id:((a=h.modules)==null||(a=a.speech)==null?void 0:a.voice_id)??g.speech.voice_id,pitch:(o=h.modules)==null||(o=o.speech)==null?void 0:o.pitch,rate:(s=h.modules)==null||(s=s.speech)==null?void 0:s.rate,ssml:(l=h.modules)==null||(l=l.speech)==null?void 0:l.ssml,language:(u=h.modules)==null||(u=u.speech)==null?void 0:u.language},vrm:(d=h.modules)?.vrm,live2d:(m=h.modules)?.live2d},agents:h.agents??{}}:{modules:g,agents:{}}}function v(e){if(`data`in e){let t=e;return{name:t.data.name,version:t.data.character_version??`1.0.0`,description:t.data.description??``,creator:t.data.creator??``,notes:t.data.creator_notes??``,notesMultilingual:t.data.creator_notes_multilingual,personality:t.data.personality??``,scenario:t.data.scenario??``,greetings:[t.data.first_mes,...t.data.alternate_greetings??[]],greetingsGroupOnly:t.data.group_only_greetings??[],systemPrompt:t.data.system_prompt??``,postHistoryInstructions:t.data.post_history_instructions??``,messageExample:t.data.mes_example?t.data.mes_example.split(` +`).filter(Boolean).map(e=>e.split(` +`).map(e=>{if(e.startsWith(`{{char}}:`)||e.startsWith(`{{user}}:`))return e;throw Error(`Invalid message example format: ${e}`)})):[],tags:t.data.tags??[],extensions:{airi:_(t),...t.data.extensions}}}return{...e,extensions:{airi:_(e),...e.extensions}}}return a(()=>{let{t}=l();e.value.set(`default`,v({name:`ReLU`,version:`1.0.0`,description:w(t(`prompt.prefix`),t(`prompt.suffix`)).content}))}),d(r,e=>{var t,n,r;if(!e)return;let i=_(e);i&&(c.value=i==null||(t=i.modules)==null||(t=t.consciousness)==null?void 0:t.model,p.value=i==null||(n=i.modules)==null||(n=n.speech)==null?void 0:n.model,f.value=i==null||(r=i.modules)==null||(r=r.speech)==null?void 0:r.voice_id)}),{cards:e,activeCard:r,activeCardId:t,addCard:m,removeCard:h,getCard:g,currentModels:n(()=>({consciousness:{model:c.value},speech:{model:p.value,voice_id:f.value}})),systemPrompt:n(()=>{let e=r.value;if(!e)return``;let t=[e.systemPrompt,e.description,e.personality].filter(Boolean);return t.join(` +`)})}}),wt=i(`chat`,()=>{let{stream:e}=xe(),{systemPrompt:t}=s(Ct()),n=o(!1),r=o([]),i=o([]),a=o([]),l=o([]),u=o([]),d=o([]),f=o([]),p=o([]);function m(e){r.value.push(e)}function h(e){i.value.push(e)}function g(e){a.value.push(e)}function _(e){l.value.push(e)}function v(e){u.value.push(e)}function y(e){d.value.push(e)}function b(e){f.value.push(e)}function x(e){p.value.push(e)}let w=o([{role:`system`,content:t.value}]),T=o({role:`assistant`,content:``,slices:[],tool_results:[]});async function E(t,o){try{var s;if(n.value=!0,!t)return;for(let e of r.value)await e(t);let m=S({onLiteral:async e=>{for(let t of u.value)await t(e);T.value.content+=e;let t=T.value.slices.at(-1);if(t?.type===`text`){t.text+=e;return}T.value.slices.push({type:`text`,text:e})},onSpecial:async e=>{for(let t of d.value)await t(e)}}),h=C({handlers:[async e=>{if(e.data.type===`text`){await m.consume(e.data.text);return}if(e.data.type===`tool-call`){T.value.slices.push(e.data);return}e.data.type===`tool-call-result`&&T.value.tool_results.push(e.data)}]});T.value={role:`assistant`,content:``,slices:[],tool_results:[]},w.value.push({role:`user`,content:t}),w.value.push(T.value);let g=w.value.slice(0,w.value.length-1).map(e=>{if(e.role===`assistant`){let{slices:t,...n}=e;return n.tool_results=c(n.tool_results),c(n)}return c(e)});for(let e of i.value)await e(t);for(let e of a.value)await e(t);let _=(s=o.providerConfig)?.headers||{},v=await e(o.model,o.chatProvider,g,{headers:_,onToolCall(e){h.add({type:`tool-call`,toolCall:e})},onToolCallResult(e){h.add({type:`tool-call-result`,id:e.id,result:e.result})}});for(let e of l.value)await e(t);let y=``;for await(let e of ce(v.textStream,async e=>e))h.add({type:`text`,text:e}),y+=e;await m.end();for(let e of f.value)await e();for(let e of p.value)await e(y);console.debug(`LLM output:`,y)}catch(e){throw console.error(`Error sending message:`,e),e}finally{n.value=!1}}return{sending:n,messages:w,streamingMessage:T,send:E,onBeforeMessageComposed:m,onAfterMessageComposed:h,onBeforeSend:g,onAfterSend:_,onTokenLiteral:v,onTokenSpecial:y,onStreamEnd:b,onAssistantResponseEnd:x}}),Tt=i(`mcp`,()=>{let e=u(`settings/mcp/server-cmd`,``),t=u(`settings/mcp/server-args`,``),n=u(`mcp/connected`,!1);return{serverCmd:e,serverArgs:t,connected:n}}),Et=globalThis.WebSocket,Dt=async e=>new Promise(t=>setTimeout(t,e));var Ot=class{constructor(t){if(e.defineProperty(this,`connected`,!1),e.defineProperty(this,`opts`,void 0),e.defineProperty(this,`websocket`,void 0),e.defineProperty(this,`eventListeners`,new Map),e.defineProperty(this,`reconnectAttempts`,0),e.defineProperty(this,`shouldClose`,!1),this.opts={url:`ws://localhost:6121/ws`,possibleEvents:[],onError:()=>{},onClose:()=>{},autoConnect:!0,autoReconnect:!0,...t},this.opts.autoConnect)try{this.connect()}catch(e){console.error(e)}}async retryWithExponentialBackoff(e,t=0,n=-1){if(n!==-1&&t>=n){console.error(`Maximum retry attempts (${n}) reached`);return}try{await e()}catch(r){console.error(`Encountered an error when retrying`,r),await Dt(2**t*1e3),await this.retryWithExponentialBackoff(e,t++,n)}}async tryReconnectWithExponentialBackoff(){await this.retryWithExponentialBackoff(()=>this._connect(),this.reconnectAttempts)}_connect(){return new Promise((e,t)=>{if(this.shouldClose){e();return}if(this.connected){e();return}this.websocket=new Et(this.opts.url),this.onEvent(`module:authenticated`,async e=>{let t=e.data.authenticated;t?this.tryAnnounce():this.retryWithExponentialBackoff(()=>this.tryAuthenticate())}),this.websocket.onerror=e=>{var n,r;if((n=(r=this.opts).onError)?.call(r,e),`error`in e&&e.error instanceof Error&&e.error.message===`Received network error or non-101 status code.`){if(this.connected=!1,!this.opts.autoReconnect){var i,a,o,s;(i=(a=this.opts).onError)?.call(a,e),(o=(s=this.opts).onClose)?.call(s),t(e.error);return}t(e.error)}},this.websocket.onclose=()=>{var e,t,n,r;(e=(t=this.opts).onClose)?.call(t),this.connected=!1,this.opts.autoReconnect?this.tryReconnectWithExponentialBackoff():(n=(r=this.opts).onClose)?.call(r)},this.websocket.onmessage=e=>{this.handleMessage(e)},this.websocket.onopen=()=>{this.reconnectAttempts=0,this.opts.token?this.tryAuthenticate():this.tryAnnounce(),this.connected=!0,e()}})}async connect(){await this.tryReconnectWithExponentialBackoff()}tryAnnounce(){this.send({type:`module:announce`,data:{name:this.opts.name,possibleEvents:this.opts.possibleEvents}})}tryAuthenticate(){this.opts.token&&this.send({type:`module:authenticate`,data:{token:this.opts.token||``}})}async handleMessage(e){try{let t=JSON.parse(e.data),n=this.eventListeners.get(t.type);if(!n)return;for(let e of n)await e(t)}catch(e){var t,n;console.error(`Failed to parse message:`,e),(t=(n=this.opts).onError)?.call(n,e)}}onEvent(e,t){this.eventListeners.get(e)||this.eventListeners.set(e,[]);let n=this.eventListeners.get(e);n&&(n.push(t),this.eventListeners.set(e,n))}send(e){var t;(t=this.websocket)?.send(JSON.stringify(e))}sendRaw(e){var t;(t=this.websocket)?.send(e)}close(){this.shouldClose=!0,this.connected&&this.websocket&&(this.websocket.close(),this.connected=!1)}};const kt=i(`server`,()=>{let e=o();a(()=>{e.value=new Ot({name:`stage-web`,autoConnect:!1,autoReconnect:!0,onError:e=>{console.error(e)}})});function t(){var t;(t=e.value)?.connect()}return{server:e,connect:t}});export{Ze as generateSpeech,Ct as useAiriCardStore,oe as useAudioContext,wt as useChatStore,Xe as useConsciousnessStore,X as useProvidersStore,se as useSpeakingStore,St as useSpeechStore}; \ No newline at end of file diff --git a/assets/sury-DmrZ3_Oj-BVfox27b.js b/assets/sury-DmrZ3_Oj-DcdBDUxn.js similarity index 54% rename from assets/sury-DmrZ3_Oj-BVfox27b.js rename to assets/sury-DmrZ3_Oj-DcdBDUxn.js index d45edf1d5b41cad2301a1ccf3c06032b4873144e..c558fd6def9ac145bb1065b2db8e4139b9cca2a3 100644 --- a/assets/sury-DmrZ3_Oj-BVfox27b.js +++ b/assets/sury-DmrZ3_Oj-DcdBDUxn.js @@ -1 +1 @@ -import{__vitePreload as e}from"./index-BSwg6FIo.js";import{tryImport as t}from"./index-CISmcbXk-D9DoS9jO.js";const n=async()=>{let{toJSONSchema:n}=await t(e(()=>import(`./__vite-optional-peer-dep_sury_xsschema-CwAhyDn8.js`),[]),`sury`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{__vitePreload as e}from"./index-DKziOBM4.js";import{tryImport as t}from"./index-CISmcbXk-DB1OKNbQ.js";const n=async()=>{let{toJSONSchema:n}=await t(e(()=>import(`./__vite-optional-peer-dep_sury_xsschema-CwAhyDn8.js`),[]),`sury`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/together-ai-DnlRcpSP.js b/assets/together-ai-BcVdn6ff.js similarity index 82% rename from assets/together-ai-DnlRcpSP.js rename to assets/together-ai-BcVdn6ff.js index 9fabecd9754fce0cd56e00b15e936f193705172e..a112bb2a1d5e5f27e19ac5b9b19e0869f5548c74 100644 --- a/assets/together-ai-DnlRcpSP.js +++ b/assets/together-ai-BcVdn6ff.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`together-ai`;var x=r({__name:`together-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon-color":(o=w.value)?.iconColor,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`togetherapi-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.together.xyz/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`together-ai`;var x=r({__name:`together-ai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon-color":(o=w.value)?.iconColor,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`togetherapi-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.together.xyz/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/useIconAnimation-DBzeTvDN.js b/assets/useIconAnimation-DZK17st3.js similarity index 84% rename from assets/useIconAnimation-DBzeTvDN.js rename to assets/useIconAnimation-DZK17st3.js index fcd6169899694f3165f25b6771d6c37d29b56d65..b553ee979c32c720c57bbb9bd1d8627e6c8eac29 100644 --- a/assets/useIconAnimation-DBzeTvDN.js +++ b/assets/useIconAnimation-DZK17st3.js @@ -1 +1 @@ -import{computed as e,onMounted as t,onUnmounted as n,ref as r,useSettings as i}from"./index-BSwg6FIo.js";function a(a){let o=r(!1),s=r(!1),c=r(a),l=i(),u=e(()=>s.value&&!l.disableTransitions&&l.usePageSpecificTransitions);return t(()=>{s.value=!0,requestAnimationFrame(()=>{o.value=!0})}),n(()=>{o.value=!1,s.value=!1}),{iconAnimationStarted:o,showIconAnimation:u,animationIcon:c}}export{a as useIconAnimation}; \ No newline at end of file +import{computed as e,onMounted as t,onUnmounted as n,ref as r,useSettings as i}from"./index-DKziOBM4.js";function a(a){let o=r(!1),s=r(!1),c=r(a),l=i(),u=e(()=>s.value&&!l.disableTransitions&&l.usePageSpecificTransitions);return t(()=>{s.value=!0,requestAnimationFrame(()=>{o.value=!0})}),n(()=>{o.value=!1,s.value=!1}),{iconAnimationStarted:o,showIconAnimation:u,animationIcon:c}}export{a as useIconAnimation}; \ No newline at end of file diff --git a/assets/valibot-CQk-M5rL-D-3BXXqj.js b/assets/valibot-CQk-M5rL-CUQV5usc.js similarity index 52% rename from assets/valibot-CQk-M5rL-D-3BXXqj.js rename to assets/valibot-CQk-M5rL-CUQV5usc.js index a8d1b6eda4ba1582399a8fded05bf60187155f61..a45e962d54de87cd6f8feece9a0b979e24546dd0 100644 --- a/assets/valibot-CQk-M5rL-D-3BXXqj.js +++ b/assets/valibot-CQk-M5rL-CUQV5usc.js @@ -1 +1 @@ -import{__vitePreload as e}from"./index-BSwg6FIo.js";import{tryImport as t}from"./index-CISmcbXk-D9DoS9jO.js";const n=async()=>{let{toJsonSchema:n}=await t(e(()=>import(`./dist-CONIs07P.js`),[]),`@valibot/to-json-schema`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{__vitePreload as e}from"./index-DKziOBM4.js";import{tryImport as t}from"./index-CISmcbXk-DB1OKNbQ.js";const n=async()=>{let{toJsonSchema:n}=await t(e(()=>import(`./dist-CONIs07P.js`),[]),`@valibot/to-json-schema`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/vibrant-CBTz7DBe.js b/assets/vibrant-Cho7xMN6.js similarity index 88% rename from assets/vibrant-CBTz7DBe.js rename to assets/vibrant-Cho7xMN6.js index e54abdb1045c3f60db15893a2907a470f9949a67..0b47a699aefa725acc3102bccb3f95f1b44f2525 100644 --- a/assets/vibrant-CBTz7DBe.js +++ b/assets/vibrant-Cho7xMN6.js @@ -1 +1 @@ -import{Fragment as e,createBaseVNode as t,createCommentVNode as n,createElementBlock as r,createVNode as i,defineComponent as a,normalizeStyle as o,openBlock as s,ref as c,renderList as l,toDisplayString as u,unref as d,watch as f}from"./index-BSwg6FIo.js";import"./src-CX9nVT7I.js";import{InputFile_default as p}from"./InputFile-R2knYJRe.js";import{Vibrant as m}from"./browser-_6RX04wP.js";const h={flex:``,"flex-col":``,"gap-4":``},g={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},_={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},v={flex:``,"gap-2":``},y={"h-60":``,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"rounded-lg":``},b=[`src`];var x=a({__name:`vibrant`,setup(a){let x=c([]),S=c(),C=c([]),w=c([]);function T(e){let t=new Image;t.src=URL.createObjectURL(e),t.onload=E,S.value=t}async function E(){if(!S.value)return;let e=new m(S.value),t=await e.getPalette();C.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`),w.value=Object.values(t).map(e=>JSON.stringify(e))}return f(x,e=>{T(e[0])},{deep:!0}),(a,c)=>(s(),r(`div`,h,[t(`div`,g,[(s(!0),r(e,null,l(C.value,(e,t)=>(s(),r(`div`,{key:t,style:o({backgroundColor:e}),"size-20":``,"rounded-full":``},null,4))),128))]),t(`div`,_,u(w.value),1),t(`div`,v,[i(d(p),{modelValue:x.value,"onUpdate:modelValue":c[0]||=e=>x.value=e,"h-60":``,"w-full":``},null,8,[`modelValue`])]),t(`div`,y,[S.value?(s(),r(`img`,{key:0,src:S.value.src,"h-full":``,"w-full":``,"object-contain":``},null,8,b)):n(``,!0)])]))}}),S=x;export{S as default}; \ No newline at end of file +import{Fragment as e,createBaseVNode as t,createCommentVNode as n,createElementBlock as r,createVNode as i,defineComponent as a,normalizeStyle as o,openBlock as s,ref as c,renderList as l,toDisplayString as u,unref as d,watch as f}from"./index-DKziOBM4.js";import"./src-CmPNYgc5.js";import{InputFile_default as p}from"./InputFile-DEuushJG.js";import{Vibrant as m}from"./browser-_6RX04wP.js";const h={flex:``,"flex-col":``,"gap-4":``},g={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},_={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},v={flex:``,"gap-2":``},y={"h-60":``,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"rounded-lg":``},b=[`src`];var x=a({__name:`vibrant`,setup(a){let x=c([]),S=c(),C=c([]),w=c([]);function T(e){let t=new Image;t.src=URL.createObjectURL(e),t.onload=E,S.value=t}async function E(){if(!S.value)return;let e=new m(S.value),t=await e.getPalette();C.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`),w.value=Object.values(t).map(e=>JSON.stringify(e))}return f(x,e=>{T(e[0])},{deep:!0}),(a,c)=>(s(),r(`div`,h,[t(`div`,g,[(s(!0),r(e,null,l(C.value,(e,t)=>(s(),r(`div`,{key:t,style:o({backgroundColor:e}),"size-20":``,"rounded-full":``},null,4))),128))]),t(`div`,_,u(w.value),1),t(`div`,v,[i(d(p),{modelValue:x.value,"onUpdate:modelValue":c[0]||=e=>x.value=e,"h-60":``,"w-full":``},null,8,[`modelValue`])]),t(`div`,y,[S.value?(s(),r(`img`,{key:0,src:S.value.src,"h-full":``,"w-full":``,"object-contain":``},null,8,b)):n(``,!0)])]))}}),S=x;export{S as default}; \ No newline at end of file diff --git a/assets/volcengine-CUaCa6hT.js b/assets/volcengine-BNR9YCJ3.js similarity index 81% rename from assets/volcengine-CUaCa6hT.js rename to assets/volcengine-BNR9YCJ3.js index 6bb6c23fc493bd2e5977cf45dd949421211b1b2d..91812da63ad15053d9215a8d1b882abb3b402acb 100644 --- a/assets/volcengine-CUaCa6hT.js +++ b/assets/volcengine-BNR9YCJ3.js @@ -1 +1 @@ -import{computed as e,createBaseVNode as t,createBlock as n,createVNode as r,defineComponent as i,onMounted as a,openBlock as o,ref as s,storeToRefs as c,unref as l,useI18n as u,watch as d,withCtx as f}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import{FieldInput_default as h,FieldRange_default as g}from"./src-CX9nVT7I.js";import{SpeechPlayground_default as _,SpeechProviderSettings_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`;var C=i({__name:`volcengine`,setup(i){let y=s(1),C=m(),w=p(),{providers:T}=c(w),{t:E}=u(),D=e({get:()=>{var e;return((e=T.value[x])==null||(e=e.app)==null?void 0:e.appId)||``},set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=e(()=>{var e;return!!(e=T.value[x])?.apiKey}),k=e(()=>C.availableVoices[x]||[]);async function A(e,t,n){let r=w.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=w.getProviderConfig(x),a=i.model||S;return await C.speech(r,a,e,t,{...i})}return a(async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),d(y,async()=>{let e=w.getProviderConfig(x);e.audio||={},e.audio.speedRatio=y.value}),d([T,D],async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,i)=>(o(),n(l(v),{"provider-id":x,"default-model":S},{"basic-settings":f(()=>[t(`div`,b,[r(l(h),{modelValue:D.value,"onUpdate:modelValue":i[0]||=e=>D.value=e,label:l(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.label`),description:l(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.description`),required:``},null,8,[`modelValue`,`label`,`description`])])]),"voice-settings":f(()=>[r(l(g),{modelValue:y.value,"onUpdate:modelValue":i[1]||=e=>y.value=e,label:l(E)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(E)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:f(()=>[r(l(_),{"available-voices":k.value,"generate-speech":A,"api-key-configured":O.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file +import{computed as e,createBaseVNode as t,createBlock as n,createVNode as r,defineComponent as i,onMounted as a,openBlock as o,ref as s,storeToRefs as c,unref as l,useI18n as u,watch as d,withCtx as f}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import{FieldInput_default as h,FieldRange_default as g}from"./src-CmPNYgc5.js";import{SpeechPlayground_default as _,SpeechProviderSettings_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`;var C=i({__name:`volcengine`,setup(i){let y=s(1),C=m(),w=p(),{providers:T}=c(w),{t:E}=u(),D=e({get:()=>{var e;return((e=T.value[x])==null||(e=e.app)==null?void 0:e.appId)||``},set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=e(()=>{var e;return!!(e=T.value[x])?.apiKey}),k=e(()=>C.availableVoices[x]||[]);async function A(e,t,n){let r=w.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=w.getProviderConfig(x),a=i.model||S;return await C.speech(r,a,e,t,{...i})}return a(async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),d(y,async()=>{let e=w.getProviderConfig(x);e.audio||={},e.audio.speedRatio=y.value}),d([T,D],async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,i)=>(o(),n(l(v),{"provider-id":x,"default-model":S},{"basic-settings":f(()=>[t(`div`,b,[r(l(h),{modelValue:D.value,"onUpdate:modelValue":i[0]||=e=>D.value=e,label:l(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.label`),description:l(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.description`),required:``},null,8,[`modelValue`,`label`,`description`])])]),"voice-settings":f(()=>[r(l(g),{modelValue:y.value,"onUpdate:modelValue":i[1]||=e=>y.value=e,label:l(E)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(E)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:f(()=>[r(l(_),{"available-voices":k.value,"generate-speech":A,"api-key-configured":O.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/xai-CvGLXM75.js b/assets/xai-CePM5sec.js similarity index 82% rename from assets/xai-CvGLXM75.js rename to assets/xai-CePM5sec.js index 51d1df58f897e983d4e529bf905b209661c61ef5..a4a5733e6ad37b748b7e843012070b1af87712f8 100644 --- a/assets/xai-CvGLXM75.js +++ b/assets/xai-CePM5sec.js @@ -1 +1 @@ -import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-BSwg6FIo.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-D9DoS9jO.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-BzkLfyIH.js";import"./__vite-browser-external-CoPuN2cl.js";import"./Button-AEge-Qyg.js";import"./src-CX9nVT7I.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-DetbLrEi.js";import"./composables-BpmQTBvS.js";import"./queue-Cw0r8hJ-.js";import"./sleep-CvjNLutj.js";import"./queues-XZuprNy-.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`xai`;var x=r({__name:`xai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`xai-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.x.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{computed as e,createBlock as t,createVNode as n,defineComponent as r,onMounted as i,openBlock as a,storeToRefs as o,unref as s,useI18n as c,useRouter as l,watch as u,withCtx as d}from"./index-DKziOBM4.js";import"./import-url-browser-DNuYZxPr.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-DB1OKNbQ.js";import"./types-Ba2_UENo.js";import{useProvidersStore as f}from"./stores-zsAuCjXz.js";import"./__vite-browser-external-FU9M8lFq.js";import"./Button-DdtiAfEa.js";import"./src-CmPNYgc5.js";import{ProviderAdvancedSettings_default as p,ProviderApiKeyInput_default as m,ProviderBaseUrlInput_default as h,ProviderBasicSettings_default as g,ProviderSettingsContainer_default as _,ProviderSettingsLayout_default as v}from"./components-BvWgWMX4.js";import"./composables-D7YQJsZO.js";import"./sleep-JdatAils.js";import"./queue-D6mkPVC_.js";import"./queues-BZSFjE0u.js";import"./dist-D1uPCnfx.js";import"./webgpu-aYTuek9b.js";import{route_block_default as y}from"./route-block-CC3cgg4Q.js";const b=`xai`;var x=r({__name:`xai`,setup(r){let{t:y}=c(),x=l(),S=f(),{providers:C}=o(S),w=e(()=>S.getProviderMetadata(b)),T=e({get:()=>{var e;return(e=C.value[b])?.apiKey||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=e({get:()=>{var e;return(e=C.value[b])?.baseUrl||``},set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});i(()=>{var e,t;S.initializeProvider(b),T.value=(e=C.value[b])?.apiKey||``,E.value=(t=C.value[b])?.baseUrl||``}),u([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){var e;C.value[b]={...(e=w.value)?.defaultOptions}}return(e,r)=>{var i,o;return a(),t(s(v),{"provider-name":(i=w.value)?.localizedName,"provider-icon":(o=w.value)?.icon,"on-back":()=>s(x).back()},{default:d(()=>[n(s(_),null,{default:d(()=>[n(s(g),{title:s(y)(`settings.pages.providers.common.section.basic.title`),description:s(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>{var e;return[n(s(m),{modelValue:T.value,"onUpdate:modelValue":r[0]||=e=>T.value=e,"provider-name":(e=w.value)?.localizedName,placeholder:`xai-...`},null,8,[`modelValue`,`provider-name`])]}),_:1},8,[`title`,`description`]),n(s(p),{title:s(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[n(s(h),{modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,placeholder:`https://api.x.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])}}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/zod-Db63SLXj-DHTxeu7T.js b/assets/zod-Db63SLXj-Bb2KbiPR.js similarity index 85% rename from assets/zod-Db63SLXj-DHTxeu7T.js rename to assets/zod-Db63SLXj-Bb2KbiPR.js index ef239e751998185284c8cd8a0990f3c2b7b0ea2b..7b2ec792bc85f9a8354de1999e9ba617145c2811 100644 --- a/assets/zod-Db63SLXj-DHTxeu7T.js +++ b/assets/zod-Db63SLXj-Bb2KbiPR.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-BPHwEaIn.js","assets/types-Ba2_UENo.js"])))=>i.map(i=>d[i]); -import{__vitePreload as e}from"./index-BSwg6FIo.js";import{missingDependenciesUrl as t}from"./index-CISmcbXk-D9DoS9jO.js";const n=async()=>{let n=e=>{throw Error(`xsschema: Missing zod v4 dependencies "zod". see ${t}`)},r=e=>{throw Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${t}`)};try{let{toJSONSchema:t}=await e(async()=>{let{toJSONSchema:e}=await import(`./core-DLGqGxHa.js`);return{toJSONSchema:e}},[]);n=t}catch(e){e instanceof Error&&console.error(e.message)}try{let{zodToJsonSchema:t}=await e(async()=>{let{zodToJsonSchema:e}=await import(`./esm-BPHwEaIn.js`);return{zodToJsonSchema:e}},__vite__mapDeps([0,1]));r=t}catch(e){e instanceof Error&&console.error(e.message)}return async e=>`_zod`in e?n(e):r(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{__vitePreload as e}from"./index-DKziOBM4.js";import{missingDependenciesUrl as t}from"./index-CISmcbXk-DB1OKNbQ.js";const n=async()=>{let n=e=>{throw Error(`xsschema: Missing zod v4 dependencies "zod". see ${t}`)},r=e=>{throw Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${t}`)};try{let{toJSONSchema:t}=await e(async()=>{let{toJSONSchema:e}=await import(`./core-DLGqGxHa.js`);return{toJSONSchema:e}},[]);n=t}catch(e){e instanceof Error&&console.error(e.message)}try{let{zodToJsonSchema:t}=await e(async()=>{let{zodToJsonSchema:e}=await import(`./esm-BPHwEaIn.js`);return{zodToJsonSchema:e}},__vite__mapDeps([0,1]));r=t}catch(e){e instanceof Error&&console.error(e.message)}return async e=>`_zod`in e?n(e):r(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/index.html b/index.html index 47203d860fab37dfcc00b2e5844dd22ff72628b6..de73a90c26846ad22b98645bd6ff76f31e4b7098 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ src="/remote-assets/page-external-data/js/script.js" > - + diff --git a/sw.js b/sw.js index d42f9c0f5dfe61d0c61636e443a8a0956f464673..fbed4d523eee68392827cd34494fb0269ebbe5f2 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(e[n])return;let u={};const o=s=>l(s,n),a={module:{uri:n},exports:u,require:o};e[n]=Promise.all(r.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-3aa584b4"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-CoPuN2cl.js",revision:null},{url:"assets/__vite-browser-external-CubORAmj.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-CSjxbBMs.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-CwAhyDn8.js",revision:null},{url:"assets/_...all_-B_osODv_.js",revision:null},{url:"assets/airi-card-gp_HXphd.js",revision:null},{url:"assets/alibaba-cloud-model-studio-BPpbwzjz.js",revision:null},{url:"assets/anthropic-D6Mj8Jul.js",revision:null},{url:"assets/appearance-B6qqUE9Q.js",revision:null},{url:"assets/arktype-C-GObzDh-CmNSnR89.js",revision:null},{url:"assets/audio-DlHM02zp.js",revision:null},{url:"assets/background-remove-BBVN5gMF.js",revision:null},{url:"assets/Basic-BGRWPjtG.js",revision:null},{url:"assets/browser-_6RX04wP.js",revision:null},{url:"assets/browser-CMSJHaBF.js",revision:null},{url:"assets/Button-AEge-Qyg.js",revision:null},{url:"assets/Button-D6PjaMaR.css",revision:null},{url:"assets/CardCreate-93Vgljnn.js",revision:null},{url:"assets/CardCreate-D42uwy43.js",revision:null},{url:"assets/CardCreationDialog-BsyNmiYp.js",revision:null},{url:"assets/CardCreationDialog-DOEDNVJJ.js",revision:null},{url:"assets/CardCreationDialog-Ic9YpxxK.css",revision:null},{url:"assets/CardDetailDialog-BCybvJ8-.js",revision:null},{url:"assets/CardDetailDialog-McUMnIHp.js",revision:null},{url:"assets/CardListItem-C9XT5lUo.js",revision:null},{url:"assets/CardListItem-KoeisllI.js",revision:null},{url:"assets/chat-6NJMDnl7.js",revision:null},{url:"assets/CheckBar-eDXKHwAa.js",revision:null},{url:"assets/cloudflare-workers-ai-C4yLEnia.js",revision:null},{url:"assets/color-scheme-BB8LYAOa.js",revision:null},{url:"assets/color-scheme-CHJXy8qz.css",revision:null},{url:"assets/ColorPalette-BdHvvd1C.js",revision:null},{url:"assets/components-CXqNLZbx.css",revision:null},{url:"assets/components-DetbLrEi.js",revision:null},{url:"assets/composables-BpmQTBvS.js",revision:null},{url:"assets/consciousness-NuFD6MD2.js",revision:null},{url:"assets/core-DLGqGxHa.js",revision:null},{url:"assets/deepseek-BqMiLukk.js",revision:null},{url:"assets/default-browser-DTRWbcB3.js",revision:null},{url:"assets/default-Db8QsuAx.js",revision:null},{url:"assets/default-node-G9zSbWb2.js",revision:null},{url:"assets/delays-DVvIZeUS.js",revision:null},{url:"assets/DeleteCardDialog-ChdXAy_R.js",revision:null},{url:"assets/DeleteCardDialog-DFZll3ve.js",revision:null},{url:"assets/developer-Dt-sXJ7n.js",revision:null},{url:"assets/dist-BziUufTI.js",revision:null},{url:"assets/dist-CONIs07P.js",revision:null},{url:"assets/dist-D1uPCnfx.js",revision:null},{url:"assets/duckdb-browser-coi.pthread.worker-WD1J30pV.js",revision:null},{url:"assets/duckdb-browser-coi.worker-Ji2I_m5s.js",revision:null},{url:"assets/duckdb-browser-eh.worker-B2xnDV1H.js",revision:null},{url:"assets/duckdb-browser-mvp.worker-DCs3_EjR.js",revision:null},{url:"assets/duckdb-coi-CSr8FQO4.wasm",revision:null},{url:"assets/duckdb-eh-BJOC5S4x.wasm",revision:null},{url:"assets/duckdb-mvp-8HYqhb4i.wasm",revision:null},{url:"assets/duckdb-mvp-C3i5IjU8.js",revision:null},{url:"assets/effect-WSjEuzC9-C7hO9AAX.js",revision:null},{url:"assets/elevenlabs-3r9LKRu7.js",revision:null},{url:"assets/emotions-SSc0a-LV.js",revision:null},{url:"assets/esm-BPHwEaIn.js",revision:null},{url:"assets/featherless-ai-jAdyMyy3.js",revision:null},{url:"assets/filter-message-C1Dba7ss.js",revision:null},{url:"assets/fireworks-ai-Bi6np0qU.js",revision:null},{url:"assets/general-CsrImEU_.js",revision:null},{url:"assets/google-generative-ai-C9ebffYb.js",revision:null},{url:"assets/HeaderLink-Bxs3yYEi.css",revision:null},{url:"assets/HeaderLink-rfbghXs_.js",revision:null},{url:"assets/home-YO2AF9Ir.js",revision:null},{url:"assets/IconAnimation-LJjhLEIS.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/image-Dpb9pDE7.js",revision:null},{url:"assets/import-url-browser-CajlDqRn.js",revision:null},{url:"assets/import-url-browser-DNuYZxPr.js",revision:null},{url:"assets/import-url-node-BGiLk3V8.js",revision:null},{url:"assets/index-5P7QcyEX.css",revision:null},{url:"assets/index-BSwg6FIo.js",revision:null},{url:"assets/index-CISmcbXk-D9DoS9jO.js",revision:null},{url:"assets/InputFile-R2knYJRe.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/memory-DrUUBYPC.js",revision:null},{url:"assets/memory-long-term-DUBmUqi4.js",revision:null},{url:"assets/memory-short-term-wHAWQOw0.js",revision:null},{url:"assets/messages-BWcBoWro.js",revision:null},{url:"assets/microsoft-speech-D91uNSKl.js",revision:null},{url:"assets/mistral-ai-B6ubU7d4.js",revision:null},{url:"assets/models-BJIpJbS2.js",revision:null},{url:"assets/models-BR8YPV_e.css",revision:null},{url:"assets/modules-oFdrgpO7.js",revision:null},{url:"assets/moonshot-ai-Gb1o961w.js",revision:null},{url:"assets/novita-ai-DZ-Vz6US.js",revision:null},{url:"assets/ollama-NSTufMsI.js",revision:null},{url:"assets/openai-audio-speech-CstZTITX.js",revision:null},{url:"assets/openai-audio-transcription-IjkiOEt-.js",revision:null},{url:"assets/openai-CRDWRKN8.js",revision:null},{url:"assets/openrouter-ai-mKjCEqCW.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/pages-BuUyaRGx.js",revision:null},{url:"assets/pages-Deu5sZkY.css",revision:null},{url:"assets/player2-api-DYzC8-m3.js",revision:null},{url:"assets/polaroid-DbFi6Mzo.js",revision:null},{url:"assets/providers-B-S3_fuC.js",revision:null},{url:"assets/queue-Cw0r8hJ-.js",revision:null},{url:"assets/queue-NqCetSQS.js",revision:null},{url:"assets/queues-XZuprNy-.js",revision:null},{url:"assets/route-block-CC3cgg4Q.js",revision:null},{url:"assets/scene-sC31UkJB.js",revision:null},{url:"assets/settings-_CwCCEeu.js",revision:null},{url:"assets/settings-Bw5r_FJh.js",revision:null},{url:"assets/sleep-CvjNLutj.js",revision:null},{url:"assets/speech-CjA8Vt_G.js",revision:null},{url:"assets/src-B8Pazang.css",revision:null},{url:"assets/src-CX9nVT7I.js",revision:null},{url:"assets/stage-BkAPr8zf.js",revision:null},{url:"assets/stage-Dp_65zGQ.js",revision:null},{url:"assets/stage-DPSvNNh_.css",revision:null},{url:"assets/stores-BzkLfyIH.js",revision:null},{url:"assets/sury-DmrZ3_Oj-BVfox27b.js",revision:null},{url:"assets/Textarea-CuugR8VV.js",revision:null},{url:"assets/together-ai-DnlRcpSP.js",revision:null},{url:"assets/types-Ba2_UENo.js",revision:null},{url:"assets/useIconAnimation-DBzeTvDN.js",revision:null},{url:"assets/valibot-CQk-M5rL-D-3BXXqj.js",revision:null},{url:"assets/vibrant-CBTz7DBe.js",revision:null},{url:"assets/volcengine-CUaCa6hT.js",revision:null},{url:"assets/webgpu-aYTuek9b.js",revision:null},{url:"assets/worker-Bq31kV70.js",revision:null},{url:"assets/xai-CvGLXM75.js",revision:null},{url:"assets/zod-Db63SLXj-DHTxeu7T.js",revision:null},{url:"index.html",revision:"c0ff80c512d88df511a9f7370ee2b161"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"apple-touch-icon.png",revision:"b41f3c1ba3c98364c640fe2b7348bd39"},{url:"favicon.svg",revision:"47d50a7bc31b26d14f3895982906935f"},{url:"maskable_icon_x192.png",revision:"a6ed025fb1491e8b498c9f4c0064d190"},{url:"maskable_icon_x512.png",revision:"b7b2c2d9bda88c74a295695c8a0e7468"},{url:"web-app-manifest-192x192.png",revision:"c9731148ea6befa78a495f63536c82eb"},{url:"web-app-manifest-512x512.png",revision:"bcae855d5ff588b682314fe1c6e530f0"},{url:"manifest.webmanifest",revision:"13ac96785e6c03e0cb109d13086bf9b2"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/docs\//,/^\/ui\//,/^\/remote-assets\//,/^\/api\//]}))}); +if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(e[n])return;let u={};const o=s=>l(s,n),a={module:{uri:n},exports:u,require:o};e[n]=Promise.all(r.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-3aa584b4"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-Dxcx6a0k.js",revision:null},{url:"assets/__vite-browser-external-FU9M8lFq.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-CSjxbBMs.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-CwAhyDn8.js",revision:null},{url:"assets/_...all_-CDWjTnYO.js",revision:null},{url:"assets/airi-card-B_A3U3hx.js",revision:null},{url:"assets/alibaba-cloud-model-studio-DKtpBeWj.js",revision:null},{url:"assets/anthropic-DCrOC5Oo.js",revision:null},{url:"assets/appearance-t6hovndX.js",revision:null},{url:"assets/arktype-C-GObzDh-CmNSnR89.js",revision:null},{url:"assets/audio-C1MdKXG0.js",revision:null},{url:"assets/background-remove-DWgFP94H.js",revision:null},{url:"assets/Basic-C8g-kAol.js",revision:null},{url:"assets/browser-_6RX04wP.js",revision:null},{url:"assets/browser-CMSJHaBF.js",revision:null},{url:"assets/Button-D6PjaMaR.css",revision:null},{url:"assets/Button-DdtiAfEa.js",revision:null},{url:"assets/CardCreate-4reXB0pk.js",revision:null},{url:"assets/CardCreate-DIURsdhI.js",revision:null},{url:"assets/CardCreationDialog-Cv_Hyp_I.js",revision:null},{url:"assets/CardCreationDialog-DPBvL_ac.js",revision:null},{url:"assets/CardCreationDialog-Ic9YpxxK.css",revision:null},{url:"assets/CardDetailDialog-CONcxyTr.js",revision:null},{url:"assets/CardDetailDialog-DnvIbrvr.js",revision:null},{url:"assets/CardListItem-BpM5aZB-.js",revision:null},{url:"assets/CardListItem-Df8jJDtb.js",revision:null},{url:"assets/chat-B0HcMONu.js",revision:null},{url:"assets/CheckBar-CLfRTriv.js",revision:null},{url:"assets/cloudflare-workers-ai-Cso4_BGA.js",revision:null},{url:"assets/color-scheme-CHJXy8qz.css",revision:null},{url:"assets/color-scheme-DpRkLhr5.js",revision:null},{url:"assets/ColorPalette-BB1UoLey.js",revision:null},{url:"assets/components-BvWgWMX4.js",revision:null},{url:"assets/components-CXqNLZbx.css",revision:null},{url:"assets/composables-D7YQJsZO.js",revision:null},{url:"assets/consciousness-DGt-Az-C.js",revision:null},{url:"assets/core-DLGqGxHa.js",revision:null},{url:"assets/deepseek-BzDEswlr.js",revision:null},{url:"assets/default-browser-DTRWbcB3.js",revision:null},{url:"assets/default-node-q82Mf43j.js",revision:null},{url:"assets/default-xnAH3KmJ.js",revision:null},{url:"assets/delays-DFcn4gRF.js",revision:null},{url:"assets/DeleteCardDialog-BoKcjVsa.js",revision:null},{url:"assets/DeleteCardDialog-cPOegSR1.js",revision:null},{url:"assets/developer-BDrLqOcT.js",revision:null},{url:"assets/dist-B_AZqzk2.js",revision:null},{url:"assets/dist-CONIs07P.js",revision:null},{url:"assets/dist-D1uPCnfx.js",revision:null},{url:"assets/duckdb-browser-coi.pthread.worker-WD1J30pV.js",revision:null},{url:"assets/duckdb-browser-coi.worker-Ji2I_m5s.js",revision:null},{url:"assets/duckdb-browser-eh.worker-B2xnDV1H.js",revision:null},{url:"assets/duckdb-browser-mvp.worker-DCs3_EjR.js",revision:null},{url:"assets/duckdb-coi-CSr8FQO4.wasm",revision:null},{url:"assets/duckdb-eh-BJOC5S4x.wasm",revision:null},{url:"assets/duckdb-mvp-8HYqhb4i.wasm",revision:null},{url:"assets/duckdb-mvp-C3i5IjU8.js",revision:null},{url:"assets/effect-WSjEuzC9-BizqJV0H.js",revision:null},{url:"assets/elevenlabs-DrNId1mR.js",revision:null},{url:"assets/emotions-EE6Y-cSt.js",revision:null},{url:"assets/esm-BPHwEaIn.js",revision:null},{url:"assets/featherless-ai-Ca5fPlYY.js",revision:null},{url:"assets/filter-message-ByGUaxmz.js",revision:null},{url:"assets/fireworks-ai-eLraL8LE.js",revision:null},{url:"assets/general-DWdxQoRL.js",revision:null},{url:"assets/google-generative-ai-OPnnnKDe.js",revision:null},{url:"assets/HeaderLink-Bxs3yYEi.css",revision:null},{url:"assets/HeaderLink-vGMDgqa7.js",revision:null},{url:"assets/home-ZzY7AMxo.js",revision:null},{url:"assets/IconAnimation-D-xhKJXy.js",revision:null},{url:"assets/image--dKP-ZlZ.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/import-url-browser-CajlDqRn.js",revision:null},{url:"assets/import-url-browser-DNuYZxPr.js",revision:null},{url:"assets/import-url-node-BGiLk3V8.js",revision:null},{url:"assets/index-5P7QcyEX.css",revision:null},{url:"assets/index-CISmcbXk-DB1OKNbQ.js",revision:null},{url:"assets/index-DKziOBM4.js",revision:null},{url:"assets/InputFile-DEuushJG.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/memory-DkrmmiHt.js",revision:null},{url:"assets/memory-long-term-DhH1haWG.js",revision:null},{url:"assets/memory-short-term-ZF-2h-kI.js",revision:null},{url:"assets/messages-ChSNCEvv.js",revision:null},{url:"assets/microsoft-speech-BzMvh9G0.js",revision:null},{url:"assets/mistral-ai-BfFFEoJ2.js",revision:null},{url:"assets/models-76vvgGXm.js",revision:null},{url:"assets/models-BR8YPV_e.css",revision:null},{url:"assets/modules-BnTzg3CJ.js",revision:null},{url:"assets/moonshot-ai-UFXQvwF7.js",revision:null},{url:"assets/novita-ai-CHDoxp4K.js",revision:null},{url:"assets/ollama-cl0Rrnvz.js",revision:null},{url:"assets/openai-audio-speech-92ozaSwL.js",revision:null},{url:"assets/openai-audio-transcription-CWLk8_6R.js",revision:null},{url:"assets/openai-CdWtYSM3.js",revision:null},{url:"assets/openrouter-ai-DJ3Pwf8-.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/pages-Deu5sZkY.css",revision:null},{url:"assets/pages-DN0dVd_t.js",revision:null},{url:"assets/player2-api-B_cW5fsP.js",revision:null},{url:"assets/polaroid-BoXbUjSB.js",revision:null},{url:"assets/providers-CMOdvsid.js",revision:null},{url:"assets/queue-D6mkPVC_.js",revision:null},{url:"assets/queue-DeMWSQ3F.js",revision:null},{url:"assets/queues-BZSFjE0u.js",revision:null},{url:"assets/route-block-CC3cgg4Q.js",revision:null},{url:"assets/scene-DrliOSzk.js",revision:null},{url:"assets/settings-D1j-vsv3.js",revision:null},{url:"assets/settings-DWdpldbJ.js",revision:null},{url:"assets/sleep-JdatAils.js",revision:null},{url:"assets/speech-Bw68A32w.js",revision:null},{url:"assets/src-B8Pazang.css",revision:null},{url:"assets/src-CmPNYgc5.js",revision:null},{url:"assets/stage-ClK_9YgL.js",revision:null},{url:"assets/stage-DPSvNNh_.css",revision:null},{url:"assets/stage-rGESOq2q.js",revision:null},{url:"assets/stores-zsAuCjXz.js",revision:null},{url:"assets/sury-DmrZ3_Oj-DcdBDUxn.js",revision:null},{url:"assets/Textarea-BIh0Stpi.js",revision:null},{url:"assets/together-ai-BcVdn6ff.js",revision:null},{url:"assets/types-Ba2_UENo.js",revision:null},{url:"assets/useIconAnimation-DZK17st3.js",revision:null},{url:"assets/valibot-CQk-M5rL-CUQV5usc.js",revision:null},{url:"assets/vibrant-Cho7xMN6.js",revision:null},{url:"assets/volcengine-BNR9YCJ3.js",revision:null},{url:"assets/webgpu-aYTuek9b.js",revision:null},{url:"assets/worker-Bq31kV70.js",revision:null},{url:"assets/xai-CePM5sec.js",revision:null},{url:"assets/zod-Db63SLXj-Bb2KbiPR.js",revision:null},{url:"index.html",revision:"62d170afe6af6ad63d22c9d05b1a79d1"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"apple-touch-icon.png",revision:"b41f3c1ba3c98364c640fe2b7348bd39"},{url:"favicon.svg",revision:"47d50a7bc31b26d14f3895982906935f"},{url:"maskable_icon_x192.png",revision:"a6ed025fb1491e8b498c9f4c0064d190"},{url:"maskable_icon_x512.png",revision:"b7b2c2d9bda88c74a295695c8a0e7468"},{url:"web-app-manifest-192x192.png",revision:"c9731148ea6befa78a495f63536c82eb"},{url:"web-app-manifest-512x512.png",revision:"bcae855d5ff588b682314fe1c6e530f0"},{url:"manifest.webmanifest",revision:"13ac96785e6c03e0cb109d13086bf9b2"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/docs\//,/^\/ui\//,/^\/remote-assets\//,/^\/api\//]}))});